Google通過發布其Gemma 3家族的專門優化版本來使其在日常硬件上更有能力的AI模型邁出了一步內存需求。主要結果是,包括大型Gemma 3 27B變體在內的複雜模型現在可以在流行的消費者級別的圖形卡上運行,將它們從高端數據中心加速器的獨家域中移出。
Google已發出了標誌著其打算提供壓縮版本的意圖,可以減少模型尺寸和計算的需求,同時維持高準確性”。”這些QAT版本現在已經實現了該計劃。
”
該版本在3月12日的Gemma 3系列首次亮相之後。該推出引入了跨越10億至270億個參數的模型,以強勁的性能而受到讚揚- 27b模型在LMSYS Chatbot Arena等比較中得分良好,這是通過人類偏好通過人類偏好進行系統排名的模型-但它們對BF16格式的依賴依賴於BF16的依賴,這意味著重要的硬件需求,通常需要NVIDIA的H100 H100的模型。 Smarts
關鍵技術是量化感知培訓(QAT)。與僅在訓練完成後(訓練後量化或PTQ)之後簡單地壓縮模型,QAT將較低的數值精度直接集成到訓練環本身中,在此過程中模擬了這些操作。
Google表示,它將Qat應用於5,000個訓練步驟,從本質上使用少數培訓步驟,使用少數博客,以port efter port efter port
The practical benefit is a steep reduction in the VRAM (video memory) needed just to hold the model’s parameters. Gemma 3 27B模型的重量佔用的重量從54 GB(BF16)降低到14.1 GB(INT4)。
這種減小意味著14.1 GB INT4版本現在非常適合24GB VRAM在卡片上,在卡片上發現了NVIDIA RTX 3090。 NVIDIA RTX 4060筆記本電腦),從8 GB到2.6 GB的4B和從2 GB到0.5 GB的小1B。儘管這些節省是可觀的,但
來源: Google
Google prudently added in its announcement: “This figure only represents the VRAM required to load the model weights. Running the model also requires additional VRAM for the KV cache, which stores information about the ongoing conversation and depends on the context length”.
The KV cache holds intermediate calculations related to the input sequence, growing larger as conversations or processed documents get longer, consuming additional memory beyond the base model weights.基於QAT的內存保存補充了Gemma 3中現有的建築效率,旨在減輕KV高速緩存的增長。
功能,重要的是,這些效率提高似乎並不犧牲核心功能。基於model details, the Gemma 3 QAT models retain features from their BF16 predecessors, including the ability to process image inputs alongside text and maintain the extensive 128,000-token context window.
This long context capability is aided by architectural choices in the base Gemma 3 design, such as alternating local sliding window attention with global attention mechanisms, which helps manage the memory demands of the KV cache在長期互動中,根據模型的技術報告。根據較早的報告,涵蓋140多種語言的廣泛語言支持也有望繼續。
在自己的機器上運行:體驗和障礙
VRAM還原為在廣泛擁有的硬件上運行這些模型打開了大門。西蒙·威利森(Simon Willison)分享了積極的早期體驗,通過 ollama (使用大約22GB RAM System Wide)和 mlx> mlx 在他的個人機器上,在他的個人機器上,在他的個人機器上找到了越來越富含MLX版本的
此外,諸如Reddit之類的平台上的社區成員觀察到,QAT型號的官方GGGUF文件(諸如llama.cpp之類的工具使用的量化模型)是比理論上大於 for Int4 for int int int int int int4 provest 4 promess。 This was traced to the token embeddings table – which numerically represents words for the model – within the official GGUF files remaining unquantized (at half precision).
Savvy users demonstrated that by manually quantizing this specific table, the file sizes could be reduced further (fitting 12B in under 8GB, 27B under 16GB), potentially enabling use on GPUs with tighter VRAM constraints,儘管有非正式的修改。
生態系統支持和可用性
Google已使官方的INT4和Q4_0 QAT模型可通過擁抱face 和 kaggle ,使用其內部TPU基礎架構(TPUV4P,V5P,V5E)訓練。至關重要的是,它們設計用於與流行開發人員工具集成。 Ollama中存在本機支持, lm Studio MLX,MLX(用於Apple Silicon),Google自己的 gemma.cpp (c ++ cpu推斷)和llama.cpp(llama.cpp)和lllama.cpp(通過gguf格式)(通過gguf格式)。 href=“ https://ai.google.dev/gemma/gemma/gemmavers” target=“ _ blank”> gemmaverse ,“ unsploth href=“ https://huggingface.co/collections/ggml-org/gemma-3-67d126315ac815ac810df1ad9e913″ target=“ _ black”> ggml 通常使用ptq方法/質量 效率推動了整個行業
Gemma 3 QAT版本在更廣泛的行業集中於使AI模型更加有效和易於訪問。就在Google宣佈公告的前一天,Microsoft Research揭示了B1.58 2B4T。
bitnet代表了一種不同的策略,採用了以極低的1.58位精度進行的本機培訓,主要針對CPU效率。儘管Microsoft聲稱取得了令人印象深刻的結果,但必須使用專業的 c ++框架(bitnet.cpp)作為標準圖書館而不是其獨特的數學來優化。這與Google使用更標準的INT4格式並利用現有的,廣泛採用的GPU推理工具的方法形成鮮明對比,這可能為專注於在消費者圖形卡上運行模型的開發人員提供了更輕鬆的採用路徑。