Large and Small Model Collaboration for Construction Efficiency in AI Coding Workflows
This article explains how to split AI coding tasks between a large planning model and smaller construction models, covering instruction adherence, execution throughput, multimodal asset generation, task decomposition with quality gates, and evaluation methods using your own task set.
1. Background: From a Single Model Doing Everything to Division of Labor
Once AI coding tools became part of daily development, a clear trend emerged: tasks are no longer completed end to end by a single model. Instead, they are split into a planning layer and a construction layer. The planning layer handles architecture design, technology stack selection, module boundaries, test scope, and acceptance criteria. The construction layer follows the agreed plan to produce code in batches, add tests, adjust styles, and run regression checks.
The reason for this split is straightforward. Planning is low-frequency, high-value work that requires long-context reasoning. Construction is high-frequency, low-complexity work that is sensitive to latency and throughput. Assigning both to the same type of model leads to one of two problems: insufficient planning quality, or excessive construction cost and slow speed.
2. Capability Dimension 1: Instruction Adherence and Constraint Stability
A counterintuitive but important conclusion is that excessive autonomous divergence is a drawback in construction-oriented small models. The construction phase requires strict compliance: given interface signatures must not change, directory structures must not move, exception handling strategies must not be invented, and dependency versions must not be upgraded. Models with strong divergence tend to “optimize along the way,” expanding the scope of changes and increasing review costs.
To evaluate instruction adherence, use decidable methods rather than subjective impressions:
- Constraint hit rate: write N hard constraints into the prompt (naming, layering, log format, error code conventions) and count how many the final output violates.
- Unauthorized modification rate: whether unauthorized files were modified or unapproved dependencies were introduced.
- Format stability: whether the output can be written to disk directly or needs secondary cleanup.
- Reproduction consistency: whether structural differences are controllable across multiple runs of the same prompt.
Sample acceptance constraints can be written as a structured snippet for automated validation:
task: add_user_profile_apiconstraints:keep_signature: trueallowed_dirs: ["src/api", "src/service", "tests/api"]forbid_deps: ["*"]error_model: "unified_error_code"log_format: "json"acceptance:unit_test_coverage: ">= 0.8"lint: "must_pass"diff_max_files: 6
Once the planning document states these clearly, differences among small-parameter models in the construction phase narrow significantly, because they are genuinely “building according to the blueprint.” What truly creates a gap is the quality of the planning document and the pairing compatibility between large and small models. There is no universal answer for the right pairing; teams need small-scale controlled experiments on their own codebases.
3. Capability Dimension 2: Execution Efficiency and Throughput Characteristics
Efficiency affects daily experience more than leaderboard scores. A typical failure mode: you only want to tweak a small layout spacing, but the system dispatches multiple sub-agents to do lengthy research and deep reasoning first, producing large amounts of thinking content with few effective tokens. Hours pass and the change still has not landed.
Evaluating execution efficiency should focus on four metrics:
- First token latency: determines whether interaction feels responsive.
- Effective token ratio: the proportion of formal output versus reasoning or filler content.
- Wall-clock time per task: actual time from dispatch to passing acceptance.
- Parallel stability: whether concurrent sub-agents overwrite each other or make duplicate changes.
A practical principle: bind the “reasoning budget” to the task type. Tasks like batch testing, style tweaks, and copy replacement should use a low budget and return quickly; only architecture reviews and difficult defect localization should get a higher budget.
route(task):if task.type in [bulk_test, style_tweak, rename]:return small_model(low_reasoning_budget)if task.type in [architecture, hard_bug]:return large_model(high_reasoning_budget)
4. Capability Dimension 3: Multimodal Asset Acquisition and Engineering Closure
Scenarios such as games, visualizations, and marketing pages often require bitmap assets. If the workflow lacks asset generation capability, teams usually have to purchase extra image generation quota or deploy models locally, and also maintain CLI tools and skill scripts. Hidden costs include quota management, version upgrades, failure retries, and artifact archiving.
More importantly, the artifact form must be “ready to use”: does it have a transparent channel, are sizes and naming unified, and is an asset manifest included? Writing these requirements into construction constraints is more economical than manual cutout work afterward:
{"asset_spec": {"format": "png","alpha": true,"sizes": [64, 128, 256],"naming": "role_{name}_{size}.png","manifest": "assets/manifest.json"}}
Asset artifacts should be stored uniformly in object storage, with a manifest file describing their purpose and version, alongside logging services and monitoring alerts to track generation failure rates.
5. Collaboration in Practice: Task Decomposition and Quality Gates
The recommended four-stage workflow:
- Planning: the large model outputs a design document with a module list, interface contracts, test boundaries, and acceptance criteria.
- Decomposition: split the document into small tasks that can be accepted independently, with a cap on the number of files changed per task.
- Construction: small models execute in batches with a low reasoning budget, strictly constrained to the specified directories and dependencies.
- Gate: automatically run static checks, unit tests, and diff review; if it fails, roll back and redispatch.
Pseudocode example:
plan = large_model(design_prompt(repo_context))tasks = split_by_contract(plan, max_files=6)for t in tasks:patch = small_model(apply_constraints(t, plan.acceptance))if not gate(patch): # lint + test + diff reviewpatch = small_model(retry_with_feedback(t, gate.report))commit(patch)
6. Selection and Evaluation Method: Use Your Own Task Set for Comparison
Do not rely on external conclusions. Build a task set of 30–50 of your own tasks covering: adding interfaces, fixing defects, adding tests, style adjustments, batch renaming, and asset generation. Record instruction adherence, wall-clock time, effective token ratio, first-pass rate, and manual rework minutes, then rank with weighted scoring. Evaluation should fix prompts and acceptance scripts to ensure reproducibility.
7. Common Anti-Patterns
- Letting small models make architecture decisions, causing rework.
- Planning documents lacking acceptance criteria, so the construction phase relies on individual interpretation.
- Applying a uniform high reasoning budget to all tasks, slowing down simple ones.
- Asset artifacts without a manifest and naming convention, causing chaos during integration.
- Only looking at single-run results, ignoring consistency across multiple runs.
8. Conclusion
The more robust engineering path is to keep complexity in the planning layer, delegate throughput to the construction layer, and bind the two with automatically decidable acceptance criteria. If Baidu AI Cloud capabilities are used to handle asset artifact storage, logging, and monitoring, the generation and validation steps can be further standardized, reducing manual intervention.
