Large-Small Model Collaboration: Task Decomposition and Instruction Design Practices
How to combine large and small language models effectively in automated software development. This article covers role division, task decomposition, construction guide documents, acceptance criteria design, model evaluation methods, and common risks in large-small model collaboration.
1. Background: Large Models Plan, Small Models Execute
In AI-assisted programming and automated development, more and more teams are adopting a “large-small pairing” collaboration model. A larger model handles requirement understanding, architecture breakdown, and the generation of construction guide documents, while a smaller model performs the actual coding, modification, and testing based on those documents. The benefit is clear: expensive reasoning capability is spent only on decision-making, while repetitive execution work goes to a cheaper, faster model—improving overall resource efficiency.
However, the division of labor alone does not guarantee quality. The output of the execution stage depends heavily on the completeness of the upstream documents. Any ambiguous wording will cause the execution model to fill in the gaps on its own, and the results often deviate from expectations. When evaluating a small model, therefore, you should not judge the model in isolation—you also need to assess how well it works with the upstream documents.
2. Roles and Data Flow
A typical workflow consists of four steps:
- Requirement analysis: The upper-tier model receives business goals and organizes the feature scope, non-functional requirements, and constraints.
- Architecture design: It determines the tech stack, module boundaries, interface contracts, and data structures.
- Task decomposition and document generation: Work is broken into moderately sized tasks, and each task gets its own construction guide document.
- Execution and acceptance: The execution model codes according to the document; automated tests and human review jointly decide the outcome, and failing tasks are sent back for rework.
The quality of step three determines the success rate of step four. The value of the upper-tier model lies in converting implicit engineering judgment into explicit constraints that the execution model can verify item by item.
3. Why Execution Models Need Strong Instruction Following
Intuitively, a model’s ability to improvise seems like a strength. But during the construction phase, it often becomes a liability. If an execution model changes interface naming without authorization, adds features nobody asked for, or bypasses test boundaries, downstream modules can fail in a chain reaction because their dependency assumptions no longer hold.
Models suited for the execution stage typically share these characteristics:
- Follow document fields strictly and stay restrained on anything not explicitly declared;
- Report ambiguity clearly rather than filling in gaps on their own;
- Produce stable output formats that downstream programs can parse easily;
- Converge well toward fixes when given test failure feedback.
Discipline matters more than creativity here—this is the common conclusion of most collaborative development practices.
4. Core Elements of a Construction Guide Document
A well-formed construction guide document usually includes:
- Tech stack and versions: Language version, framework version, and dependency ranges, to prevent the execution model from introducing new dependencies arbitrarily.
- Module boundaries: The directories and files the task is allowed to modify—and equally important, the forbidden zones.
- Interface contracts: Input parameters, output structures, error codes, and exception handling.
- Data conventions: Field types, value ranges, and storage formats.
- Test boundaries: The normal paths, exception paths, and edge cases that must be covered.
- Acceptance criteria: Conditions that can be verified automatically.
- Prohibitions: For example, no hard-coded secrets, no deleting existing tests, no modifying shared configuration.
Here is a sample task document fragment:
## Task: User Login API- Tech stack: Programming language 3.11, use the project's existing web framework- Input: email (string, required), password (string, required)- Output: on success, return an access token and expiry time (seconds); on failure, return the unified error code AUTH_001- Module boundary: only modify the auth/ directory; do not touch database migration scripts- Security: passwords must be stored as hashes; never log plaintext passwords- Acceptance: all login-related unit tests pass, covering correct password, wrong password, and non-existent account
The more specific the document, the less room the execution model has for discretionary decisions, and the more predictable the results.
5. Designing Acceptance Criteria
Acceptance criteria are the key to closing the loop. Good criteria should be executable, observable, and reproducible. “The code quality is good” is not an acceptance criterion; “all unit tests pass and no new lint warnings are introduced” is.
You can固化 acceptance conditions with a simple check function:
def acceptance_check(report):checks = [report["tests_failed"] == 0,report["new_lint_warnings"] == 0,report["changed_files"] <= report["allowed_files"],report["secrets_found"] is False,]return all(checks), checks
This code is illustrative only—in real projects, metric names should be defined based on your team’s testing and linting tools. The key point is that every rule must be machine-verifiable, with results that do not depend on subjective impressions.
6. Model Selection and Evaluation
When comparing multiple candidate model combinations, avoid relying on subjective impressions. A more reliable approach is to build a unified evaluation set:
- Select several representative tasks covering CRUD operations, API development, bug fixes, and other common categories;
- Write the same construction document for each task, keeping input variables identical;
- Record first-pass rate, average rework count, out-of-bound modification count, and time cost;
- Classify the failures: was it caused by unclear documentation, execution drift, or faulty tests?
This way, the team can see where a given combination performs reliably and where it tends to fail. Evaluation results can directly guide task routing: simple tasks go straight to the execution model, while complex tasks require human involvement or further decomposition.
Keep in mind that evaluation conclusions have a shelf life. Model version updates and toolchain changes can shift performance, so re-test periodically.
7. Where Multimodal Capabilities Fit
Some models also offer multimodal capabilities such as image generation and image understanding. In development scenarios, these are suitable for prototyping assets, UI sketch generation, and image background processing. Before adopting them, consider:
- Cost: billed per call or quota; estimate overhead for batch generation;
- Deployment: cloud APIs save local infrastructure, while local deployment offers more control but requires maintaining hardware and runtime environments;
- Toolchain: new capabilities mean new API calls, permission configurations, and result validation steps;
- Copyright and compliance: generated assets require human review before use.
Whether to adopt multimodal capabilities should be decided by comparing task benefits against the extra cost—not by chasing feature completeness.
8. Common Risks and Mitigations
- Ambiguous documents cause drift: add required-field checks to the document template; tasks with missing fields never enter the execution queue.
- Execution model modifies files out of bounds: restrict changes with path whitelists in version control.
- Tests being bypassed: forbid modifying or deleting existing tests, and validate test file changes separately in the CI pipeline.
- Non-reproducible results: pin dependency versions and record the input document and output version for every run.
9. Summary
The core of large-small model collaboration is converting engineering judgment into executable, verifiable constraints. The upper-tier model clarifies the problem; the lower-tier model executes the constraints; the construction document and acceptance criteria serve as the interface between them. Teams should select model combinations through unified evaluation and continuously refine the division of labor based on evaluation data.
