Showing posts with label Google Developers. Show all posts
Showing posts with label Google Developers. Show all posts

15.8.25

Gemma 3 270M: Google’s Tiny, Task-Tunable Model Built for On-Device Speed and Efficiency

 Google has introduced Gemma 3 270M, a compact 270-million-parameter model designed specifically for task-focused fine-tuning and on-device deployment. Unlike general chat models, this release emphasizes reliable instruction-following, tight text structuring, and extremely low power draw—ideal for teams that want small, specialized models they can train and ship quickly. 

What’s inside a “270M” Gemma

Gemma 3 270M splits its parameters into ~170M for embeddings and ~100M for transformer blocks. The unusually large 256k token vocabulary helps it handle rare and domain-specific tokens, making it a strong base for targeted tasks across languages and verticals. In Google’s IFEval tests, the model sets a new bar for instruction adherence in its size class. 

Built for batteries, browsers, and bare-metal

Efficiency is the headline: Google reports that an INT4-quantized build on a Pixel 9 Pro used roughly 0.75% battery over 25 conversations, making this the most power-frugal Gemma yet. Production-ready Quantization-Aware Training (QAT) checkpoints are available at launch, so developers can serve INT4 with minimal quality loss on phones, laptops, or small servers. 

What it’s good at (and what it isn’t)

Out of the box, Google is shipping both a pre-trained and an instruction-tuned checkpoint. The tuned variant is not aimed at long, free-form conversations; instead, it excels at structured tasks—classification, entity extraction, routing, policy or compliance checks, and converting unstructured text into schema-bound outputs. This “right tool for the job” stance mirrors results seen when enterprises fine-tune larger Gemma models for narrow domains (e.g., Adaptive ML’s SK Telecom moderation project), but now at a fraction of the cost and latency. 

Developer on-ramp

Getting started is intentionally trivial. You can download weights from Hugging Face, Ollama, Kaggle, LM Studio, or Docker Hub, try the model on Vertex AI, and run locally with llama.cpp / Gemma.cpp / LiteRT / Keras / MLX. For tuning, Google documents full fine-tuning recipes and points to Hugging Face, Unsloth, and JAX toolchains. The model inherits Gemma 3’s architecture, so existing Gemma-based pipelines and guardrails transfer cleanly. 

Where it fits in your stack

If you’ve been defaulting to big models for every job, 270M argues for fleet thinking: deploy multiple tiny experts—one for routing, one for extraction, one for compliance—each fine-tuned on a few thousand examples. You gain latency, privacy, and cost wins (especially on devices), and you reduce failure modes tied to long prompts and brittle few-shot scaffolds. For retrieval pipelines, 270M can act as the fast, deterministic head that classifies queries or validates outputs before a heavier model is invoked. 

Practical pointers

  • Quantize early. Start with the QAT INT4 checkpoint to match the power and memory profile you’ll ship with. 

  • Constrain formats. Lean into schema-first prompting (JSON schemas) so the model’s instruction-following strengths show up in production logs. 

  • Measure ROI. Compare a fine-tuned 270M against your current medium/large model on latency, accuracy for your narrow task, and unit cost per 1k requests. 

The bigger Gemma picture

Gemma 3 spans from nano-class on-device models like 3n to larger multimodal variants. The 270M release fills a clear gap: a production-oriented “smallest useful” text model with first-party quantization and batteries-included docs, distribution, and tooling. For many workflows, that’s the difference between a cool demo and a service you can afford to run 24/7. 

Takeaway: Gemma 3 270M is a pragmatic tool for shipping AI where efficiency, control, and privacy matter more than sheer breadth of capability. If your team needs fast, reliable, structured text handling on phones or low-cost servers—and wants to fine-tune in hours, not days—this tiny Gemma may be the new default.

31.7.25

LangExtract: Google’s Gemini-Powered Library That Turns Raw Text into Reliable Data

 

A new way to mine insight from messy text

On July 30 2025 the Google Developers Blog unveiled LangExtract, an open-source Python package that promises to “unlock the data within” any text-heavy corpus, from clinical notes to customer feedback threads. Built around Gemini models but compatible with any LLM, the project aims to replace brittle regex pipelines with a single declarative interface for extraction, visualization and traceability. 

Why LangExtract stands out

LangExtract combines seven features that rarely appear together in one tool:

  1. Precise source grounding – every entity you pull out is linked back to its exact character span in the original document, so auditors can see where a value came from.

  2. Schema-enforced outputs – you describe the JSON you want, add a few examples, and the library leverages Gemini’s controlled generation to keep responses on-spec.

  3. Long-context optimisation – chunking, parallel passes and multi-stage recall tame “needle-in-a-haystack” searches across million-token inputs.

  4. Interactive HTML visualisation – one command turns results into a self-contained page where extractions glow inside the source text.

  5. Flexible back-ends – swap Gemini for on-device Ollama models or any OpenAI-compatible endpoint.

  6. Domain agnosticism – the same prompt-plus-examples recipe works for finance, law, medicine or literature.

  7. Apache-2.0 licence – no gating, just pip install langextract

How it works in practice

A “quick-start” script pulls Shakespeare characters, emotions and relationships in about a dozen lines of code, then writes an interactive HTML overlay showing each extraction highlighted inside the play. The same pattern scales: push the full Romeo and Juliet text through three extraction passes and LangExtract surfaces hundreds of grounded entities while keeping recall high. G

The GitHub repository already counts 200+ stars less than a week after launch, and ships with examples for medication extraction and structured radiology reporting—fields where provenance and accuracy are critical. A live Hugging Face demo called RadExtract shows the library converting free-text X-ray reports into structured findings, then color-coding the original sentences that justify each data point. 

Under the hood: Gemini plus controlled generation

When you pass model_id="gemini-2.5-flash" (or -pro for harder tasks), LangExtract automatically applies Google’s controlled generation API to lock output into the schema you defined. That means fewer JSON-parse errors and cleaner downstream pipelines—something traditional LLM calls often fumble. For massive workloads, Google recommends a Tier-2 Gemini quota to avoid rate limits. 

Why developers should pay attention

Information extraction has long oscillated between hand-tuned rules (fast but brittle) and heavyweight ML pipelines (accurate but slow to build). LangExtract offers a third path: prompt-programming simplicity with enterprise-grade traceability. Because it’s open-source, teams can audit the chain of custody and fine-tune prompts to their own compliance rules instead of black-box vendor filters.

Whether you’re structuring earnings calls, tagging sentiment in product reviews, or mapping drug-dosage relationships in EMRs, LangExtract turns unreadable text into queryable data—without sacrificing transparency. For AI enthusiasts, it’s also a practical showcase of what Gemini’s long-context and schema-control features can do today.

Bottom line: install the package, craft a clear prompt, add a few gold examples, and LangExtract will handle the rest—from parallel chunking to an HTML dashboard—so you can move straight from raw documents to actionable datasets.

 Most “agent” papers either hard-code reflection workflows or pay the bill to fine-tune the base model. Memento offers a third path: keep t...