Cactus Needle(GitHub リポジトリ):Gemini 3.1 から蒸留された軽量モデルがローカル環境で高速動作
Gemini 3.1 から蒸留された 26M パラメータの軽量モデル「Cactus Needle」が、Mac や PC でローカル実行可能となり、消費者向けデバイス向けの AI 再定義を推進する重要な進展となった。
キーポイント
高性能な軽量モデルの登場
Gemini 3.1 を基に蒸留された 26M パラメータの Simple Attention Network が、Cactus 上で 6,000 トークン/秒の事前処理と 1,200 トークン/秒の生成速度を達成した。
ローカル環境での完全な利用
Mac や PC 上でモデルをファインチューニングして実行可能であり、重みは完全にオープンソース化されているため、開発者の自由な活用が保証される。
消費者向けデバイスへの最適化
Simple Attention Network はスマートフォン、スマートウォッチ、AR グラスなどのリソース制約のある端末での AI 実行を再定義することを目的としている。
影響分析・編集コメントを表示
影響分析
このニュースは、大規模モデルを小規模・高効率な形に変換する蒸留技術の実用化が加速していることを示しており、クラウド依存からエッジデバイスへの AI 分散化という業界の大きな転換点を象徴しています。特にオープンソース化とローカル実行の容易さは、開発者コミュニティにおけるイノベーションの速度をさらに高める要因となるでしょう。
編集コメント
大規模モデルの「小さく、速く、賢く」なるトレンドが具体化された事例であり、エッジデバイスでの AI 普及に向けた重要なマイルストーンです。
Gemini 3.1 を、Mac/PC でローカルでもファインチューニング可能な 2600 万パラメータの「Simple Attention Network」に圧縮しました。
本番環境では、Needle は Cactus 上で動作し、プリフィル速度は 6000 トークン/秒、デコード速度は 1200 トークン/秒です。
重みとデータセット生成プロセスは、Cactus-Compute/needle で完全にオープンソース化されています。
d=512, 8H/4KV, BPE=8192
┌──────────────┐
│ Tool Call │
└──────┬───────┘
┌┴──────────┐
│ Softmax │
└─────┬─────┘
┌─────┴─────┐
│ Linear (T)│ ← tied
└─────┬─────┘
┌─────┴─────┐
│ ZCRMSNorm │
└─────┬─────┘
┌────────┴────────┐
│ Decoder x 8 │
│┌───────────────┐│
││ ZCRMSNorm ││
││ Masked Self ││
││ Attn + RoPE ││
││ Gated Residual││
│├───────────────┤│
┌──────────────┐ ││ ZCRMSNorm ││
│ Encoder x 12 │──────────────────────▶Cross Attn ││
│ │ ││ Gated Residual││
│ ┌──────────┐ │ │└───────────────┘│
│ │ZCRMSNorm │ │ └────────┬────────┘
│ │Self Attn │ │ ┌─────┴─────┐
│ │ GQA+RoPE │ │ │ Embedding │ ← shared
│ │Gated Res │ │ └─────┬─────┘
│ │ │ │ ┌───────┴───────-┐
│ │ (no FFN) │ │ │[EOS]<tool_call>│
│ └──────────┘ │ │ + answer │
│ │ └───────────────-┘
└──────┬───────┘
│
┌────┴──────┐
│ Embedding │
└────┬──────┘
│
┌────┴──────┐
│ Text │
│ query │
└───────────┘
- 16 台の TPU v6e で 200B トークン(27 時間)に事前学習済み。
- シングルショット関数呼び出しデータセット 2B トークンでポストトレーニング済み(45 分)。
Needle は、Simple Attention Networks の実験的な実装であり、消費者向けデバイス(スマートフォン、スマートウォッチ、AR グラスなど)向けの超小型 AI を再定義することを目的としています。したがって、個人用 AI におけるシングルショット関数呼び出しのタスクでは FunctionGemma-270m、Qwen-0.6B、Graninte-350m、LFM2.5-350m を上回りますが、これらのモデルはより広い範囲と能力を持ち、会話型設定において特に優れています。また、小規模なモデルは扱いが繊細である場合もあります。次のセクションにある UI を使用して、ご自身のツールでテストし、ワンクリックで微調整を行ってください。
Quickstart
git clone https://github.com/cactus-compute/needle.git
cd needle && source ./setup
needle playground
http://127.0.0.1:7860 で Web UI を起動し、ご自身のツールでテストや微調整が可能です。モデル重みは自動的にダウンロードされます。
Usage (Python)
from needle import SimpleAttentionNetwork, load_checkpoint, generate, get_tokenizer
params, config = load_checkpoint("checkpoints/needle.pkl")
model = SimpleAttentionNetwork(config)
tokenizer = get_tokenizer()
result = generate(
model, params, tokenizer,
query="What's the weather in San Francisco?",
tools='[{"name":"get_weather","parameters":{"location":"string"}}]',
stream=False,
)
print(result)
[{"name":"get_weather","arguments":{"location":"San Francisco"}}]
Finetuning
プレイグラウンド (Gemini を経由してデータを生成し、トレーニング・評価を行い、結果をバンドル)
needle playground
CLI (ローカルに重みがない場合は自動ダウンロード)
needle finetune data.jsonl
CLI
needle playground Web UI を介してテストおよびファインチューニング
needle finetune <data.jsonl> 独自のデータ上でファインチューニング
needle run --query "..." --tools 単一の推論実行
needle train 完全なトレーニング実行
needle pretrain PleIAs/SYNTH 上での事前学習
needle eval --checkpoint <path> チェックポイントの評価
needle tokenize データセットのトークン化
needle generate-data Gemini を経由してトレーニングデータを合成
needle tpu <action> TPU マネージメント (docs/tpu.md を参照)
@misc{ndubuaku2026needle,
title={Needle},
author={Henry Ndubuaku, Jakub Mroz, Karen Mosoyan, Roman Shemet, Parkirat Sandhu, Satyajit Kumar, Noah Cylich, Justin H. Lee},
year={2026},
url={https://github.com/cactus-compute/needle}
}
原文を表示
We distilled Gemini 3.1 into a 26m parameter "Simple Attention Network" that you can even finetune locally on your Mac/PC.
In production, Needle runs on Cactus at 6000 toks/sec prefill and 1200 decode speed.
Weights are fully open on Cactus-Compute/needle, as well as the dataset generation.
d=512, 8H/4KV, BPE=8192
┌──────────────┐
│ Tool Call │
└──────┬───────┘
┌┴──────────┐
│ Softmax │
└─────┬─────┘
┌─────┴─────┐
│ Linear (T)│ ← tied
└─────┬─────┘
┌─────┴─────┐
│ ZCRMSNorm │
└─────┬─────┘
┌────────┴────────┐
│ Decoder x 8 │
│┌───────────────┐│
││ ZCRMSNorm ││
││ Masked Self ││
││ Attn + RoPE ││
││ Gated Residual││
│├───────────────┤│
┌──────────────┐ ││ ZCRMSNorm ││
│ Encoder x 12 │──────────────────────▶Cross Attn ││
│ │ ││ Gated Residual││
│ ┌──────────┐ │ │└───────────────┘│
│ │ZCRMSNorm │ │ └────────┬────────┘
│ │Self Attn │ │ ┌─────┴─────┐
│ │ GQA+RoPE │ │ │ Embedding │ ← shared
│ │Gated Res │ │ └─────┬─────┘
│ │ │ │ ┌───────┴───────-┐
│ │ (no FFN) │ │ │[EOS]<tool_call>│
│ └──────────┘ │ │ + answer │
│ │ └───────────────-┘
└──────┬───────┘
│
┌────┴──────┐
│ Embedding │
└────┬──────┘
│
┌────┴──────┐
│ Text │
│ query │
└───────────┘
- Pretrained on 16 TPU v6e for 200B tokens (27hrs).
- Post-trained on 2B tokens of single-shot function call dataset (45mins).
Needle is an experimental run for Simple Attention Networks, geared at redefining tiny AI for consumer devies (phones, watches, glasses...).
So while it beats FunctionGemma-270m, Qwen-0.6B, Graninte-350m, LFM2.5-350m on single-shot function call for personal AI,
Those model are have more scope/capacity and excel in conversational settings. Also, small models can be finicky.
Please use the UI in the next section to test on your own tools, and finetune accordingly, at the click of a button.
Quickstart
git clone https://github.com/cactus-compute/needle.git
cd needle && source ./setup
needle playgroundOpens a web UI at http://127.0.0.1:7860 where you can test and finetune on your own tools. Weights are auto-downloaded.
Usage (Python)
from needle import SimpleAttentionNetwork, load_checkpoint, generate, get_tokenizer
params, config = load_checkpoint("checkpoints/needle.pkl")
model = SimpleAttentionNetwork(config)
tokenizer = get_tokenizer()
result = generate(
model, params, tokenizer,
query="What's the weather in San Francisco?",
tools='[{"name":"get_weather","parameters":{"location":"string"}}]',
stream=False,
)
print(result)
# [{"name":"get_weather","arguments":{"location":"San Francisco"}}]Finetuning
# Playground (generates data via Gemini, trains, evaluates, bundles result)
needle playground
# CLI (auto-downloads weights if not local)
needle finetune data.jsonlCLI
needle playground Test and finetune via web UI
needle finetune <data.jsonl> Finetune on your own data
needle run --query "..." --tools Single inference
needle train Full training run
needle pretrain Pretrain on PleIAs/SYNTH
needle eval --checkpoint <path> Evaluate a checkpoint
needle tokenize Tokenize dataset
needle generate-data Synthesize training data via Gemini
needle tpu <action> TPU management (see docs/tpu.md)
@misc{ndubuaku2026needle,
title={Needle},
author={Henry Ndubuaku, Jakub Mroz, Karen Mosoyan, Roman Shemet, Parkirat Sandhu, Satyajit Kumar, Noah Cylich, Justin H. Lee},
year={2026},
url={https://github.com/cactus-compute/needle}
}
関連記事
今日のまとめ
AI日報で今日の重要ニュースをまとめ読み