메뉴
HN
Hacker News • 46일 전

온디바이스 AI 'Needle2': 14MB 초소형 모델 공개

IMP
8/10
핵심 요약

스마트폰, 웨어러블, 로봇 등 200달러 미만의 저사양 기기에서 초고속으로 구동되는 14MB 크기의 온디바이스 에이전트 AI 모델이 공개되었습니다. 모델 자체를 극도로 가볍게 설계하여 기기 제어와 데이터 추출에 특화되었으며, 클라우드 연결 없이도 완벽한 프라이버시와 즉각적인 응답을 제공하는 것이 핵심입니다.

번역된 본문

45M 매개변수(Params) | Pi5 기준 초당 800+ 토큰(prefill) | Pi5 기준 초당 500+ 토큰(decode) | CQ2-bit 압축 | 14MB 파일 크기 | 28MB 세션 RAM

우리의 베팅: 200달러 미만 기기에 온디바이스 AI를 최근 엣지(Edge) AI는 Mac이나 PC를 의미하는 경우가 많았지만, 진정한 엣지 환경은 대부분 저렴한 하드웨어입니다. 약 15억 대의 PC와 달리 210억 개 이상의 사물인터넷(IoT) 기기가 연결되어 있으며, 신흥 시장에서 출고되는 대부분의 스마트폰은 200달러 미만입니다. 저렴한 폰, 라즈베리 파이, 마이크로컨트롤러, 웨어러블, Reachy Mini 같은 소형 로봇, 스마트홈 기기까지 합산하면 전 세계 엣지 기기의 약 5분의 4가 200달러 미만입니다. Needle이 타겟으로 하는 하드웨어는 GPU도, NPU도 없고 RAM은 수백 MB 수준인 바로 그 기기들입니다.

함수 호출 및 기기 제어 전등을 켜는 데 최첨단 대형 AI 모델이 필요하지 않습니다. 시계, 스마트홈, 로봇은 이미 데이터 타입이 지정된 매개변수를 통해 자신의 기능(function)을 제공합니다. 따라서 어려운 부분은 사용자의 복잡한 문장을 해당 기능들에 매핑하는 것, 즉 '어떤 기능을, 어떤 값으로 실행할 것인가'뿐입니다. 이렇게 접근하면 방대한 세상에 대한 지식이나 개방형 산문 생성이 필요하지 않으므로, 수십억 개의 매개변수가 필요한 챗봇과 달리 45M(4500만) 개의 매개변수로 충분합니다. 이러한 작은 설계가 모든 것의 출발점입니다.

데이터 추출 및 구조화된 출력 스키마(Schema, 데이터 구조)가 인터페이스이며, 이 개념은 문서 처리에도 적용됩니다. 스키마와 단락이 주어지면 타입이 지정된 필드를 반환하고, enum 필드는 분류기 역할을 하며, 배열 필드는 한 번의 호출로 목록을 수집합니다. 우리는 이를 단순한 관례가 아닌 엄격한 계약(Contract)으로 강제합니다. 모든 대화 차례는 호출 봉투(Call envelope)로 응답하며, 빈 호출은 요청 거부를 의미하고, 선언된 스키마에서 컴파일된 바이트 수준의 문법이 모든 토큰을 제약합니다. 이 문법이 구문을 담당하므로 45M의 모든 매개변수는 기능을 선택하고 사용자의 말에서 인수를 찾는 데 온전히 집중합니다.

엣지-클라우드 협업 어떤 소형 모델도 모든 것을 커버할 수는 없으므로, Needle은 임의로 추측하는 대신 상황을 명확히 알려줍니다. 모든 응답에는 학습된 신뢰도 점수(Confidence score)가 포함되며, 주제를 벗어난 요청에는 빈 호출을 반환합니다. 설정된 임계값(Threshold) 이상이면 기기가 직접 작동하고, 미만이면 재질문하거나 클라우드로 작업을 넘깁니다. 대부분의 기기 제어 요청은 일상적인 작업이므로 클라우드 이관은 드물게 일어나며, 기본 동작 경로는 프라이빗하고 즉각적이며 무료로 유지됩니다.

무손실 2비트 양자화(Quantization) 소형 모델은 사후 양자화(Post-hoc quantization)를 거치면 성능이 망가집니다. 그래서 우리는 사후 양자화를 절대 하지 않습니다. Needle 2는 사전 학습(Pretrain)부터 사후 학습(Post-train)까지, 가중치와 활성화, KV 캐시에 이르기까지 모두 'Cactus Quants'를 기반으로 학습되었습니다. 배포되는 2비트 모델은 학습된 모델 그 자체입니다. 이것이 성능 손실이나 배터리 소모 없이 45M 매개변수를 14MB에 담아내는 비결입니다.

모델과 추론 엔진의 공동 설계 모든 아키텍처 설계는 매개변수를 부여받기 전에 타겟 하드웨어에서 벤치마킹되었습니다. 최종 결과물은 단순한 모델 가중치가 아닌 모델과 추론 엔진의 쌍입니다. 의존성이 전혀 없는 단일 C++ 바이너리는 시작 시 CPU를 프로브하여 최적의 커널을 선택하며, 그 안에 모델, 토크나이저, 문법 컴파일러가 모두 포함되어 있습니다. 단일 산출물로 Cortex-M, x86, WebAssembly 등 모든 곳에서 실행됩니다. 설치하거나 다운로드할 필요가 없습니다.

Mac/PC에서 파인튜닝(Fine-tune) 모든 제품에는 고유한 도구 어휘가 있으며, 45M 모델은 매우 작아서 실행되는 환경에서 직접 재학습할 수 있습니다. 이 저장소와 파이썬 패키지는 여러분의 컴퓨터에서 몇 분에서 몇 시간 안으로 조정 및 테스트를 마칩니다. 범용 어시스턴트가 아닌, 여러분의 기기 도구에 최적화된 Needle을 출시하세요.

상용화 준비 완료 Needle은 최소한의 RAM 사용, 짧은 지연 시간, 프라이버시, 오프라인 안정성이 필수적인 제품을 위한 상용화 준비를 마쳤습니다. 현대 웨어러블 산업의 선구자인 Pebble은 네트워크 연결 없이 음성 요청을 행동으로 변환하기 위해 'Index 01' 앱 내부에서 이 모델을 로컬로 구동합니다. “Pebble Index Ring에는 화면이 없습니다. 따라서 말을 걸 때 인터넷 연결 여부와 상관없이 매번 즉각적으로 행동이 일어나야만 합니다. 우리는 클라우드에 의존하는 대신 앱 내부에서 Cactus Needle을 로컬로 실행합니다. 모델의 크기는 매우 작으면서도 그 성능은 결코 우리를 실망시키지 않습니다.”

아키텍처 Needle 2는 자체적인 115B(1,150억) 토큰 규모의 코퍼스로 사전 학습되었으며, 압축된 추론 트레이스와 정교한 데이터셋 분배 설계를 통해 38B(380억) 토큰으로 사후 학습되었습니다. 규모를 비교해 보자면, LFM2.5-230M은 19조 개의 토큰으로 사전 학습되었으며, 이는 Needle의 약 120배에 해당합니다.

원문 보기
원문 보기 (영어)
45M Params 800+ tok/s Pi5 prefill 500+ tok/s Pi5 decode CQ2-bit Compression 14 MB File size 28 MB Session RAM Our Bet Bringing On-Device AI to <$200 Devices : Edge AI has lately meant Macs and PCs, but the edge is mostly cheap hardware: over 21 billion connected IoT devices against roughly 1.5 billion PCs, and in emerging markets most phones ship under $200. Count budget phones, Raspberry Pis, microcontrollers, wearables, small robots like Reachy Mini, and connected home devices, and roughly four in five edge devices cost under $200. That is the hardware Needle targets: no GPU, no NPU, a few hundred MB of RAM. Function Call & Device Use : Turning on a light does not need a frontier model. A watch, a home, a robot: each already exposes its abilities as functions with typed parameters, so the only hard part is mapping a messy sentence onto them: which function, with which values. Framed that way, the problem needs no world knowledge and no open-ended prose, which is why 45M parameters suffice where chat needs billions. That smaller formulation is the bet everything else follows from. Extraction & Structured Outputs : The schema is the interface, and the same formulation covers documents: a schema plus a paragraph returns typed fields, an enum field is a classifier, an array field collects a list in one call. We enforce this with a contract, not a convention: every turn is answered with a call envelope, the empty call is the refusal, and a byte-level grammar compiled from the declared schemas constrains every token. The grammar carries the syntax, so all 45M parameters go to choosing functions and grounding arguments in the user&#x27;s words. Edge-Cloud Collaboration : No small model covers everything, so Needle says so instead of guessing: every response carries a learned confidence score, and off-topic requests return the empty call. Above your threshold, act; below it, re-ask or escalate to the cloud. Most device requests are routine control, so escalation stays rare and the default path stays private, instant, and free. Lossless 2bit Quantization : Small models break under post-hoc quantization, so we never quantize post-hoc: Needle 2 trains against Cactus Quants from pretrain through post-train, weights, activations, and KV cache alike. The 2bit model you deploy is the model that was trained. That is what fits 45M parameters into 14MB with nothing lost on our battery. Co-designed Model & Inference : Every architectural choice was benchmarked on the target hardware before it earned its parameters, and the deliverable is the pair, not the weights: a single dependency-free C++ binary that probes the CPU at startup and picks its kernels, with the model, tokenizer, and grammar compiler sealed inside. One artifact runs from Cortex-M to x86 to WebAssembly. There is nothing to install and nothing to download. Fine-tune on your Mac/PC : Every product has its own tool vocabulary, and a 45M model is small enough to retrain where it runs: the repo and python package tune and test on your own computer in minutes to a few hours. Ship a Needle that speaks your device&#x27;s tools, not a generic assistant. Production Needle is production-ready for products that require a minimal RAM footprint, low latency, privacy, and offline reliability. Pebble - the pioneer of the modern wearable industry - runs it locally in the Index 01 app to turn spoken requests into actions without depending on a network connection. “ The Pebble Index Ring has no screen. So when you speak to it, the action just has to happen, every time, with or without internet connection. We run Cactus Needle locally in the app, instead of relying on the cloud. The model&#x27;s footprint is tiny and the performance never lets us down. Architecture Needle 2 is pretrained on a proprietary 115B-token corpus and post-trained on 38B tokens with compact reasoning traces and careful dataset distribution design. For scale: LFM2.5-230M was pretrained on 19 trillion tokens, roughly 120× Needle&#x27;s total, and the evaluation below shows the two trading wins. Each component exists to buy capability without buying bandwidth. The Hadamard MLP replaces the usual dense up-and-down projections with a fixed Walsh transform and learned diagonals, so the channel mixing that dominates a small model&#x27;s weight reads costs almost no parameters at all. The engram moves world knowledge out of the stack into hashed n-gram tables that are read a few rows per token: capacity that is nearly free at decode time, which matters on devices where every megabyte read from flash is latency and battery. The multi-lane residual streams give a 27-layer, 512-wide network the routing flexibility of a much wider one, at the cost of a few dot products per layer rather than more attention or MLP volume. The memory system is designed backwards from fixed-RAM devices. Attention uses a 256-token sliding window so the KV cache is bounded no matter how long a session runs, and the system prompt and tool declarations are pinned as permanent sinks so the one thing a tool-calling model must never forget—its tools—is structurally unable to be evicted. The cache itself is trained with QAT, and weights are stored in Cactus Quants at a mixed bits per weight averaging 2bit. The result is that quality decisions and deployment decisions stay decoupled: one trained model, specialized to whatever precision and window a target device can afford. The engine earns its speed from what it refuses to compute. Weights never decompress into RAM: the 2-bit codes are expanded inside vector registers, fused into integer dot products, so resident memory stays at blob size and the arithmetic path is int8 end to end—activations, KV cache, and the lane routing tables alike. The grammar is an optimization, not just a guarantee: because the matcher knows which tokens are legal before the logits exist, the engine computes output scores only for candidate rows, skipping up to 98% of the vocabulary projection on structural tokens, and skips it entirely on steps whose output is already forced. One universal binary probes the CPU at startup and self-selects its kernel tier—SDOT, NEON, AVX2, RISC-V vectors, wasm SIMD, or scalar—and the thread pool spins through the short serial sections of a token instead of sleeping, which alone nearly doubled decode. None of this changes a single output: every trick is either exact or validated token-for-token against the reference path. All of it is ultimately an energy argument. On device silicon, moving a byte out of flash or DRAM costs orders of magnitude more than a multiply-accumulate, so the budget that matters is FLOPs per token and bytes per token together. The architecture cuts the first: a conventional transformer of Needle&#x27;s width and depth spends 164 MFLOPs per token, and even one squeezed down to Needle&#x27;s parameter count spends 87, because every parameter it owns must be exercised through a matmul. Needle spends 70, and keeps a fifth of its parameters as gathered memory that costs no arithmetic at all. The binary cuts the second, as the engine section showed: nothing rematerializes, the arithmetic stays int8 end to end, and the grammar prunes compute outright, so decoding a token reads at most the 14MB blob once, and on structural tokens meaningfully less. This is what battery life is made of. Even on a high-end phone, an always-on assistant lives inside a power budget; every MFLOP is milliwatt-hours, and Needle spends 7× to 85× fewer of them per token than the models it is benchmarked against. Bounded session memory is what puts microcontrollers in reach. Because the sliding window caps state, Needle 2&#x27;s RAM is a deterministic 28MB ceiling, not a curve that grows with conversation length. That fits MCU-class parts with external RAM, such as ESP32-P4 with 32MB of PSRAM, or STM32H7 and NXP i.MX RT boards with SDRAM. The engine compiles single-threaded for bare metal and ships as a static library for Cortex-M4, M7, an