Reasoning and agent work
Artificial Analysis's Intelligence Index scores Qwen3.8 27B at 20 on xhigh effort and Gemma 4 31B at 4 in reasoning mode. Qwen's score scales with effort: 17 at medium, 16 at low and 10 with thinking off. Gemma's non-reasoning variant has no index score. Gemma's index entry is old: it dates from April 2026 and the index was rebuilt in October for harder agent tasks.
On the agent tests that index uses, Qwen scored 5.6% on Terminal-Bench 4.0, 14.9% on FrontierCode-AA 2.0 and 48.2% on AutomationBench-AA. Gemma scored 0%, 0% and 4.9%. Neither is a serious agent model against the frontier, but only Qwen is usable for multi-step automation.
Both cards report scores on older, easier benchmarks. Qwen reports 90.3% on LiveCodeBench v6 and Gemma reports 80.0%. Qwen reports 61.7% on SWE-bench Pro in a Claude Code harness, 73.0% on Terminal Bench 2.1 and 84.3% on OSWorld-Verified. Gemma reports 76.9% on Tau2 and a Codeforces rating of 2150. These are vendor figures with different harnesses.
Sources: artificialanalysis.ai, artificialanalysis.ai, huggingface.co, huggingface.co
Chat quality, languages and multimodal input
Gemma 4 31B has the higher LMArena text score, 1452 against 1434, which suggests voters prefer its answers in open conversation even though it trails on hard reasoning. Google lists out-of-the-box support for more than 35 languages and pre-training covering more than 140. Qwen's card does not state its language coverage.
Qwen3.8 27B accepts text, image and video. Gemma 4 31B accepts text and images and treats video as a sequence of frames; audio is limited to Gemma's smaller E2B, E4B and 12B variants. Gemma lets you set an image token budget of 70, 140, 280, 560 or 1,120, a useful control: low budgets suit captioning and high budgets suit OCR and document parsing.
Sources: huggingface.co, huggingface.co, arena.ai
Context, thinking controls and speed
Both have a native 256K token context window. Qwen's card says it extends to 1,000,000 tokens with YaRN rope scaling, but warns that static YaRN can hurt performance on short texts, so turn it on only for long inputs. Qwen can produce up to 262,144 tokens of reasoning and 131,072 of final answer.
Thinking is on by default in Qwen, with reasoning_effort set to xhigh, medium or low, and it can be disabled per request. In Gemma you switch thinking on by adding a thinking token to the system prompt, and the card advises leaving earlier thoughts out of the conversation history, except during tool calls. Gemma supports native function calling.
Qwen is slow at xhigh: 47 tokens per second, about 128 seconds to the first answer token and 38.7 minutes per Index task. Gemma outputs about 36 tokens per second with a 78.7 second wait to first answer. Artificial Analysis lists Gemma's non-reasoning variant at about 41 tokens per second and 3.9 seconds to first token.
Sources: huggingface.co, huggingface.co, artificialanalysis.ai, artificialanalysis.ai
Price, hosting and licence
Both are Apache 2.0. Qwen3.8 27B has a 27B dense hybrid architecture and Gemma 4 31B is a dense 30.7B model, so either fits the same class of hardware. Neither card states GPU memory requirements. Both document Transformers, vLLM, SGLang and Docker Model Runner, plus quantised builds for llama.cpp, Ollama and LM Studio.
Pricing is unclear for Gemma. Artificial Analysis shows Google's own API at $0.00 for the reasoning variant without explanation, and a median of about $0.15 input and $0.40 output for the non-reasoning variant across 10 providers. Qwen3.8 27B is $0.50 input and $3.00 output on Alibaba's API, and Artificial Analysis puts a full Index run at $3.53 at xhigh. The Qwen card says its hosted Qwen Cloud version was still 'coming soon' on the card, although Alibaba's QwenCloud page shows a callable API.
Gemma 4 31B is the easier model to find on managed platforms: Vertex AI, Amazon Bedrock and Azure Foundry through Fireworks. Qwen3.8 27B appears on Azure Foundry as a Hugging Face-hosted entry and was not found on Bedrock or Vertex.
Sources: artificialanalysis.ai, artificialanalysis.ai, huggingface.co