Demystifying LLM Capabilities: From Sparse Architectures to Code Generation from Images
This article breaks down how to properly evaluate large language models by separating three often-confused questions: how big a model is, how expensive it is to run, and how well it performs on real tasks. It explains the actual deployment costs of sparse Mixture-of-Experts architectures—including weight storage, communication overhead, and context length effects on latency—then examines image-to-code as a three-stage verification process (information extraction, relationship understanding, and implementation validation). Finally, it covers how to evaluate real coding capability through verifiable changes and provides a practical evaluation framework covering task quality, latency, delivery cost, and edge-case behavior.
1. Start by Separating Three Questions: Model Size, Running Cost, and Task Performance
The most common mistake when evaluating large models is treating parameter count, inference overhead, and task performance as a single metric. Total parameters describe how many trainable parameters a model has. Activated parameters describe how many parameters actually participate in computation for a given processing step—for sparse models, this is usually measured per token. Task performance must be judged through independent testing. These three are related, but they are not interchangeable.
In a typical dense architecture, most parameters in a given layer participate in the computation for every token. A sparse Mixture-of-Experts (MoE) architecture usually keeps a shared computation component and replaces part of the feed-forward network with multiple expert subnetworks. A router selects a small number of experts based on each token’s hidden state. This way, total parameters can grow without the per-token compute growing at the same rate. Note that “experts” here are simply selectable subnetworks—they do not inherently correspond to human-defined skills like “good at coding” or “good at reading images.”
One important distinction: sparse activation does not mean adding more layers, and you cannot convert one architecture into an “equivalent” model of a different parameter scale. If someone claims two architectures have “comparable capability,” ask comparable on which set of tasks’ pass rates, under which workload’s throughput, or at what quality per unit of cost. Different evaluation conditions can lead to completely different conclusions.
2. The Real Gains of Sparse Architectures Must Account for Weights, Communication, and Context
Activating fewer parameters does not mean you only need to store the activated weights at deployment time. To ensure that different requests can access the experts they need, serving infrastructure typically still has to accommodate all expert weights across the deployment, or bear the overhead of weight scheduling and loading. When experts are distributed across multiple accelerator cards, tokens must be sent to the corresponding devices, and results must be sent back. If a large number of tokens get routed to a few experts, some devices may queue up while others sit idle. In such cases, a theoretical reduction in compute does not translate into a proportional reduction in user-visible latency.
Context length also changes the cost structure. When a model reads long documents, codebase snippets, or high-resolution images, input processing time increases. During generation, the key-value cache used for attention must be maintained, and its footprint scales with context length, concurrency, and implementation details. Deployment evaluations should therefore record time to first token (TTFT) and full response latency separately, while also observing the latency of slower requests under high concurrency. For interactive programming, TTFT determines whether feedback feels responsive; for batch document processing, stable throughput and the cost of failed retries usually matter more.
3. Code Generation from Images Is Not One Capability—It’s Three Verification Gates
Multimodal models can convert images into internal representations and generate answers combined with text instructions. But going from an image to runnable code must pass at least three gates: information extraction, relationship understanding, and implementation validation. An error at an earlier gate can be wrapped by a later gate into code that looks reasonable, so examining only the final output makes it hard to locate the problem.
- Information extraction: Did the model see the key details? When inputting a UI screenshot, first ask the model to list the fields, buttons, status indicators, and any unreadable text. For dense tables or long screenshots, test both the full image and cropped sections to see whether small-font recognition improves, and whether cropping loses column headers or the relationships between regions.
- Relationship understanding: Are observations kept separate from inferences? A screenshot can show where buttons are and their current state, but it usually cannot explain why a button is disabled, nor does it provide API contracts or permission rules. Ask for output that explicitly labels items as “visible in the image,” “inferred from layout,” or “needs business confirmation.” For interaction logic, prefer supplying the specification rather than letting the model guess based on common patterns.
- Implementation validation: Does the generated result actually meet the requirements? A page that renders does not mean form validation, keyboard handling, and error messages are correct. Beyond comparing visual layout, run build and interaction tests covering empty values, extreme inputs, and request-failure scenarios. If the screenshot contains real business data, mask irrelevant sensitive fields before submitting it to the model.
This layered verification also applies to chart interpretation. For example, if a model gives a wrong trend conclusion, the root cause might be missing units when reading axis scales, or comparing two curves in a dual-axis chart on the same scale. Checking the recognition results first, then the reasoning process, is more likely to reveal the path to improvement than simply asking the model to answer again.
4. Real Coding Capability Shows in Verifiable Changes
Generating a standalone function and modifying an existing codebase are two different kinds of tasks. The former mainly tests local logic; the latter also requires the model to understand module boundaries, call relationships, existing conventions, and compatibility. Dumping an entire repository into the context window does not necessarily solve the problem: key constraints may be drowned out by large amounts of irrelevant code, and reviewers will find it harder to judge which information the model actually relied on.
Take “fixing duplicate records in an import pipeline” as an example. More effective inputs include sanitized samples, expected behavior, the relevant processing functions, and existing tests. First clarify which fields define “duplicate,” how nulls are handled, and whether deduplication applies across batches; then ask the model to state the scope of its proposed change, provide a minimal diff, and supply regression tests. If the root cause is unclear, first inspect call relationships and reproduction conditions instead of adding a filter at the entry point. Otherwise, the patch may only mask the symptom in one sample while changing how valid records are processed.
When a model can invoke tools, the key is to make the tools provide independent evidence rather than letting the model declare success on its own. File reads help locate context; builds and tests can verify some assumptions—but a passing test only means the covered scenarios meet expectations. In engineering practice, separate read, write, and release permissions; run verification in an isolated environment; and keep human review and rollback mechanisms in place. For low-risk, easily reversible changes, you can shorten the confirmation process; for high-impact operations such as data migrations or permission changes, keep an explicit approval step.
5. How to Evaluate: Score Real Tasks, Not Demos
For model selection, draw a sample of real, unmodified tasks from actual work: both high-frequency tasks and boundary cases that tend to fail. For each sample, document the input, the tools allowed, the completion criteria, and the failure conditions. If a task allows iterative fixes, record both the first-attempt pass rate and the final pass rate within budget; otherwise, results achieved through multiple rounds of retries can easily be mistaken for single-shot capability.
| Evaluation Dimension | What to Record | What It Helps You Judge |
|---|---|---|
| Task quality | Field accuracy, test pass rate, unintended changes, human adoption | Whether output is usable and whether it introduces extra risk |
| Interaction and throughput | Time to first token, full response latency, tail latency under high concurrency | Better suited for real-time collaboration or batch processing |
| Delivery cost | Input/output overhead, tool runs, failed retries, human review | The real cost per qualified deliverable |
| Edge-case behavior | Handling of blurry images, missing constraints, overlong inputs, tool timeouts | Whether the model recognizes uncertainty and fails gracefully |
During testing, also record context length, output limits, tool permissions, and concurrency conditions. If one setup can run tests while the other can only generate code, the results reflect two different workflows and cannot be attributed to the models themselves. When necessary, run two comparison groups: one comparing models under identical tool conditions, and another comparing complete delivery pipelines as each would actually be deployed. The former is better for analyzing capability differences; the latter is better for making purchasing and rollout decisions.
What matters in the end is not whether a model can turn a screenshot into code in a demo, but whether it can consistently deliver verifiable results within specified quality, latency, and permission constraints. Parameter count and architecture explain part of where capability and cost come from; real samples, independent verification, and failure records determine whether that capability can make it into production.
