惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

H
Heimdal Security Blog
P
Privacy International News Feed
S
Schneier on Security
P
Proofpoint News Feed
L
Lohrmann on Cybersecurity
Spread Privacy
Spread Privacy
P
Privacy & Cybersecurity Law Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Scott Helme
Scott Helme
K
Kaspersky official blog
大猫的无限游戏
大猫的无限游戏
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
aimingoo的专栏
aimingoo的专栏
Simon Willison's Weblog
Simon Willison's Weblog
S
Securelist
Help Net Security
Help Net Security
B
Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Security Archives - TechRepublic
Security Archives - TechRepublic
云风的 BLOG
云风的 BLOG
The GitHub Blog
The GitHub Blog
N
News and Events Feed by Topic
Hacker News: Ask HN
Hacker News: Ask HN
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
M
MIT News - Artificial intelligence
雷峰网
雷峰网
博客园 - 司徒正美
V
V2EX
AWS News Blog
AWS News Blog
Know Your Adversary
Know Your Adversary
N
News | PayPal Newsroom
T
Tor Project blog
Cisco Talos Blog
Cisco Talos Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
PCI Perspectives
PCI Perspectives
Google DeepMind News
Google DeepMind News
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
U
Unit 42
C
Cybersecurity and Infrastructure Security Agency CISA
P
Palo Alto Networks Blog
G
Google Developers Blog
T
Threat Research - Cisco Blogs
博客园 - Franky
I
InfoQ
D
DataBreaches.Net
爱范儿
爱范儿
Y
Y Combinator Blog
博客园 - 叶小钗
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
I Ran Gemma 4 on a Mid-Range Android Phone — Here's What Actually Happened
Baiju Rajyag · 2026-05-16 · via DEV Community

Real benchmarks. No server. Just a Galaxy A35 5G and some patience.


Most "on-device AI" articles are written by people who tested on a Pixel 9 Pro or an iPhone 15 Pro Max, ran 10 prompts, and called it a day. This isn't that. I've been daily-driving Google's Gemma 4 E2B and E4B models on a Samsung Galaxy A35 5G (8GB RAM) for a few weeks — using them to work through Python logic puzzles and generate hardware scripts — across two different apps, two different inference backends, with close attention to what was actually limiting performance. This wasn't a quick stress test. My main focus was the E4B, because that's where things get interesting.


What Is Gemma 4, Really?

Before we get into numbers, let's make sure we're on the same page about what "E2B" and "E4B" actually mean — because it's not obvious.

The "E" stands for "Effective" parameters, not just "Edge." These models use a technique called Per-Layer Embeddings (PLE), where instead of a single embedding lookup at the input layer like a standard transformer, each decoder layer gets its own dedicated embedding vector for every token. This makes a 2B-active-parameter model punch significantly above its weight — the E2B has roughly 2.3B effective parameters but closer to 5B total stored parameters, and the E4B sits around 4.5B effective. That's why the Q4_K_M quantized file for E4B comes in at around 4.8 GB — larger than you'd expect from a "4 billion parameter" model.

Both models are genuinely multimodal out of the box: text, images, and audio — all natively, no cloud required. They use a hybrid attention mechanism that mixes local sliding window attention (512-token window) with full global attention at key layers, giving them long-context awareness without the memory cost of full attention on every layer. Context window support goes up to 128K tokens on paper.


My Setup

Device: Samsung Galaxy A35 5G — Exynos 1380, 4× Cortex-A78 performance cores, 4× Cortex-A55 efficiency cores, Mali-G68 MP5 GPU, 8GB LPDDR4X RAM.

Models tested:

  • Gemma 4 E4B — Q4_K_M quantization, downloaded from Google's official Hugging Face repo, 4.8 GB
  • Gemma 4 E2B — Q4_K_M quantization, same source

Apps used:

  • PocketPal AI — ran local GGUF files, CPU inference only (more on why below)
  • LLM Hub — downloaded the model in-app, used GPU acceleration

Settings: 4096 context length, 4096 token generation on both models and both apps.

The GPU Problem: Mali G68 MP5 Isn't Supported in PocketPal

Here's the first real-world catch that no spec sheet will tell you: PocketPal AI does not support the Mali G68 MP5 GPU on the Galaxy A35. This means all inference in PocketPal ran entirely on the CPU — specifically, only the 4 Cortex-A78 performance cores, with the efficiency cores left out of the equation.

This isn't a flaw in Gemma 4. It's a compatibility gap between the inference runtime (llama.cpp-based) and Mali's OpenCL/Vulkan implementation on this particular chip. Snapdragon and Apple Silicon users have a much smoother experience here — the A35's Exynos 1380 sits outside the well-tested hardware matrix for most on-device AI apps right now.


Benchmark Results

Gemma 4 E4B — The Main Event

Backend App Tokens/sec
CPU only (4× A78) PocketPal 3.4 – 3.6
GPU (Mali G68 MP5) LLM Hub ~3.8

The GPU gave a small but real boost — roughly 5–12% improvement. But it came at a cost: noticeably higher battery drain. Worse, LLM Hub eventually became unstable during extended sessions — it crashed and failed to reload the model into memory entirely. This sealed it: Mali G68 MP5 GPU support is still too buggy to trust as a daily driver. The CPU path in PocketPal, while slower on paper, was the only backend that stayed reliable across weeks of testing. For a gain this modest paired with that level of instability, there's no contest.

Thermal & Short-Script Advantage

Sustained generation tells only part of the story. For short, bursty tasks — like asking Gemma 4 E4B to write a Python MD5 hashing script — the phone can briefly exceed its sustained throughput ceiling. After letting the device cool down and clearing background RAM, I hit a peak of 4.10 tokens/second with an 870ms time-to-first-token (TTFT). That's a noticeably snappier experience than the 3.4–3.6 tok/s average suggests. Thermal throttling and background memory pressure are real enemies here; managing them buys you a meaningful headroom boost on short prompts even without changing any model settings.

Gemma 4 E2B — For Comparison

Running E2B on the same device produced a much more comfortable 5–7 tokens/second on CPU. That's the difference between "reads like a human typing" and "feels like AI lag." E2B is fast enough for real interactive use on this hardware. However, it fails to match the E4B in quality and reasoning, making it better suited for simple tasks and quick queries.


The Real Bottleneck: Memory Bandwidth

Here's the most important finding from this whole experiment, and it's something that doesn't get talked about enough in mobile AI discussions:

Neither the CPU nor the GPU was the limiting factor. Memory bandwidth was.

During inference, both the CPU and GPU were running at or near 100% utilization — but token throughput still plateaued. The E4B model's weight matrix is large, and during every single token generation step, the system has to stream those weights from RAM through the memory bus. The Galaxy A35's LPDDR4X memory subsystem simply can't push data fast enough to keep the compute units fed.

This is a fundamental constraint of running large quantized models on consumer mobile hardware. The compute is there. The bandwidth isn't. It explains why going from CPU to GPU gave only a marginal improvement — you moved the computation, but the data still has to travel the same slow road.

Devices with LPDDR5X or unified memory architectures (like Apple Silicon or newer Snapdragon 8 Elite) show much better performance on the same models precisely because they have higher memory bandwidth, not because their CPUs or GPUs are proportionally faster.


What This Means for Mid-Range Android Users

The Galaxy A35 sits in a realistic slice of the Android market — it's not a budget phone, but it's not flagship either. Running E4B at 3.4–3.6 tokens/second is functional, but not smooth. Here's the honest breakdown:

  • E2B at 5–7 tok/s → usable for back-and-forth conversation, lightweight reasoning, quick queries
  • E4B at 3.4–3.8 tok/s → better output quality, but you'll wait. Good for non-interactive tasks: summarization, analysis, drafting
  • GPU acceleration on Mali G68 MP5 → limited by app support right now. Don't expect miracles even when it works

If you want to run Gemma 4 on a mid-range Android device today, E2B is the pragmatic choice. E4B is worth running if output quality matters more than speed — but set your expectations accordingly.


Why Not Just Use the Giants?

A fair question. The Gemma 4 family also includes a 26B A4B Mixture-of-Experts model and a 31B Dense model — and I tested both via cloud inference. The reasoning quality is genuinely impressive; the 31B in particular shows that Google can compete at the frontier level in the cloud. But benchmarking those misses the entire point of what makes the E2B and E4B remarkable.

The 31B proves Google can build a world-class cloud model. The E2B and E4B prove something far more consequential: offline, multimodal AI is finally trickling down to the devices the rest of the world actually owns.

Think about what it means to run a 4.8 GB multimodal model natively on a mid-range phone — no Wi-Fi, no API key, no monthly subscription — in a country where data costs money and flagship hardware is out of reach for most developers. That's not a footnote. That's a shift. The gap between "AI you can experiment with" and "AI you can build on" just got a lot smaller for anyone who doesn't have a MacBook Pro or a cloud budget to burn.


Should You Try This?

Yes — with context.

Gemma 4's edge models are a genuine achievement. Multimodal input (vision + audio + text), function calling, 128K context, all in a model small enough to fit on a phone. A year ago this capability profile didn't exist at any size you could run locally.

But the Galaxy A35 — and phones like it — are memory-bandwidth constrained in a way that no amount of quantization fully solves. The models run. They produce good output. They just don't run fast.

If you're on a flagship device with LPDDR5X or an NPU with proper driver support, your experience will be materially different. For everyone else on mid-range hardware: E2B is your friend, E4B is your weekend project.


Tested on Samsung Galaxy A35 5G (8GB RAM, Exynos 1380). Models: Gemma 4 E2B and E4B, Q4_K_M quantization from Google's Hugging Face repository. Inference via PocketPal AI (CPU) and LLM Hub (GPU). Settings: 4096 context / 4096 token generation.