Nanbeige4.2-3BをApple Silicon上で動作させる:デプロイメントバグの修正とループ型トランスフォーマーのメモリオーバーヘッド削減
Nanbeige4.2-3B on Apple Silicon: Fixing Deployment Bugs and Decreasing Looped Transformer Memory Overhead
August 14, 2026
著者: John T. Halloran
cs.AI
要旨
Nanbeige4.2-3Bは、ループ型トランスフォーマー(LT)を基盤とする3Bパラメータのエージェントモデルである。LTは1つのレイヤースタックを2回目のフォワードパスで再利用し、追加パラメータなしで実効深さを増加させる。Apple Silicon(MPS)上で評価し、公開されたチェックポイントがHugging Face transformersでそのまま動作しない原因となる5つの独立したバグを特定した(暗黙的にゼロ化されたRoPEバッファや、削除されたtransformersキャッシュAPIへの呼び出しを含む)。さらに、パラメータ効率を達成するためのLTのレイヤー再利用戦略(実効的にピーク時アテンションメモリを2倍にする)により、これらのバグを修正するだけではエージェントタスクに不十分であることを示す。そこで我々は、発生するメモリ容量ペナルティを軽減するチャンク化プリフィル戦略を導入し、約32 GiBの共有メモリ上で許容コンテキスト幅を2.7倍に拡張する。しかし、メモリオーバーヘッドを削減しても、Nanbeige4.2-3Bを使用可能にするにはパッチが必要であることを示す。システムプロンプトとMPSネイティブのメモリバグの両方を解決することで、標準的なMCPおよびツール呼び出しベンチマークでの信頼性の高い評価が可能になる。MCPMarkのサブセットでは、デバッグ済みモデルは実エージェントタスクの最大30%を完了する(元のモデルの0%から向上)。一方、BFCLでは、単一ツール呼び出しではほぼ完璧であるが、複数ツールのテストの大半では失敗する。パッチ適用済みチェックポイント、システムプロンプト最適化ツール、評価ハーネスを https://github.com/johnhalloran321/Nanbeige4.2-3B-mps-fix で公開する。
English
Nanbeige4.2-3B is a 3B-parameter agentic model built around a Looped Transformer (LT) that reuses one stack of layers for a second forward pass, adding effective depth without additional parameters. Evaluated on Apple Silicon (MPS), we identify five independent bugs which prevent the released checkpoint from running via Hugging Face transformers out of the box (including a silently-zeroed RoPE buffer and calls to removed transformers cache APIs). Furthermore, we show that fixing these bugs is still not sufficient for agentic tasks, due to the LT's layer-reuse strategy (which effectively doubles peak attention memory) used to achieve parameter efficiency. We thus introduce a chunked-prefill strategy which alleviates the incurred memory-capacity penalty, extending allowable context width by 2.7 times on 32~GiB shared memory. However, even with the reduced memory overhead, we show that patches are required to render Nanbeige4.2-3B usable; resolving both system prompt and MPS-native memory bugs finally allows reliable evaluation on standard MCP and tool-calling benchmarks. On a subset of MCPMark, the debugged model completes up to 30\% of real agentic tasks (up from the original's 0\%), while, on BFCL, it is near-perfect at single tool calls (yet fails the majority of multi-tool tests). We release the patched checkpoint, system prompt optimizer, and evaluation harnesses at https://github.com/johnhalloran321/Nanbeige4.2-3B-mps-fix.