Collaborative Development with Large and Small LLMs: Instruction Following, Execution Efficiency, and Model Selection Practices
This article explores the collaborative development pattern using large and small language models. It covers the division of labor, emphasizing the critical role of instruction following and execution efficiency in small models. It also provides guidelines for writing construction guidance documents, selecting models for different task types, establishing an evaluation process, and managing potential risks to improve overall development quality and speed.
1. Background of Large and Small Model Division of Labor
In agentic-assisted development, a common practice is to divide tasks into two layers. The upper layer, handled by larger models, is responsible for requirements understanding, architecture design, technology selection, and task decomposition, outputting structured construction guidance documents. The lower layer, executed by smaller models, completes specific coding, repetitive modifications, batch testing, and style adjustments according to these documents.
The core logic is matching cost with responsibility. Architecture decisions require global cross-module reasoning and have high error costs, making them suitable for more capable models. Implementation tasks have clear inputs and outputs; as long as boundaries are well-defined, small models can execute them stably. However, after the division of labor, the output quality of small models heavily depends on the quality of the upper-layer documents. Vague documents lead to deviations in execution. Therefore, model selection should consider the combined performance of both models, not just individual scores.
2. Instruction Following: The Core Capability for Small Models
In the construction phase, the value of a small model lies in faithful execution rather than autonomous creativity. A model that excels in divergent thinking—actively adding features, rewriting interfaces, or adjusting directory structures—is advantageous in open-ended creation but introduces uncontrollable changes during construction. A construction model should have the following characteristics:
- Strictly execute according to the document: Implement only what is explicitly required, without unauthorized additions of dependencies or features.
- Maintain structural consistency: Naming, directories, and interface signatures should align with the document’s conventions.
- Stop and ask when encountering ambiguity: Instead of guessing an answer and proceeding.
- Verifiable output: Attach runnable test results or check records for every change.
When evaluating instruction following, design small tasks with explicit constraints, such as “modify only the specified function, do not change the public interface, and ensure existing tests pass,” to observe if the model crosses boundaries.
3. Writing Standards for Construction Guidance Documents
The construction guidance document is a contract between the large model and the small model. Its quality directly determines execution quality. A qualified document should contain at least:
- Program Architecture: Module division, hierarchical relationships, data flow.
- Tech Stack: Language versions, frameworks, dependency libraries, and their version ranges.
- Directory and Naming Conventions: Rules for file paths, class names, and function names.
- Interface Definition: Inputs, outputs, exception handling, and error codes.
- Testing Boundaries: Which modules require unit tests, which require integration tests, and which are out of scope.
- Acceptance Criteria: Quantifiable judgment conditions, such as test pass rate, performance thresholds, and zero linter warnings.
Here is a simplified template example:
# Construction Guide: User Order Query Module## 1. Architecture- Layering: handler -> service -> repository- Data Storage: Relational database, accessed only through the repository layer## 2. Tech Stack- Python 3.11, FastAPI 0.110+, SQLAlchemy 2.x- Prohibit introducing new third-party dependencies## 3. Interfaces- GET /orders?user_id={int}&page={int}&size={int}- Returns: {"items": [...], "total": int}- Returns 400 for invalid parameters, with an error description## 4. Testing Boundaries- Cover all branches in the service layer- Test only parameter validation in the handler layer## 5. Acceptance Criteria- All new tests pass- P95 latency for a single query under 200 ms (with 100,000 test records)- Zero static analysis warnings
The more specific the document, the less guessing the small model needs to do. Conversely, if the document merely states “implement order query feature,” the results will vary significantly regardless of which model executes it.
4. Execution Efficiency: Speed Determines Usability
Efficiency is another core value of small models. Typical characteristics of simple tasks include a small scope of changes, clear context, and explicit validation methods. For such tasks, if a model spends a long time on deep thinking in every round or breaks down into multiple sub-tasks for repeated research, the waiting time will far exceed the actual workload. For example, adjusting the spacing of a UI component should take tens of seconds, but excessive planning by the model can consume several minutes. This inefficiency is amplified in multi-round iterations.
Mass testing scenarios are particularly sensitive. Automated testing usually requires multiple rounds of “run, read results, modify, run again.” If each round adds one minute of waiting, a hundred consecutive iterations will add a hundred minutes. Therefore, selection should focus on the following metrics:
- First response time: Time from sending a request to starting output.
- Output throughput: Number of tokens generated per unit time.
- Single-round completion time: End-to-end time to complete a small task.
- Rework rate: Proportion of model output requiring manual or secondary correction.
In practice, model tiers can be selected based on task type. The table below presents a common allocation strategy:
| Task Type | Recommended Tier | Focus Areas |
|---|---|---|
| Architecture design, task decomposition | Large parameter model | Global reasoning, solution completeness |
| Coding by document, repetitive modifications | Small parameter model | Instruction following, output speed |
| Batch testing and result aggregation | Small parameter model | Throughput, format stability |
| Documentation writing, creative content | Large parameter model | Knowledge coverage, expression quality |
5. Model Selection Logic for Knowledge-Intensive and Creative Tasks
Logical reasoning capabilities can be enhanced through longer chains of thought, but a model’s grasp of world knowledge has its limits. Domain knowledge not covered in the training data cannot be conjured up through reasoning alone. Retrieval tools can fill some gaps but cannot cover all content requiring professional judgment. Therefore, parameter size is usually a more reliable reference for creative and analytical tasks requiring extensive domain knowledge.
For development scenarios, this principle can be translated into specific practices: content involving domain rules, professional terminology, and industry conventions should be prioritized for large models with broader knowledge coverage; mechanical coding should be assigned to small models with faster execution speeds.
6. Establishing Your Own Evaluation Process
Personal experience serves only as a reference; selection conclusions should come from repeatable evaluations. The recommended approach is to prepare a set of representative tasks covering the team’s real-world scenarios and record uniform metrics. Below is a simple evaluation script example to aggregate results from multiple executions:
from dataclasses import dataclassfrom statistics import mean@dataclassclass RunRecord:passed: bool # Whether acceptance tests passedfirst_try: bool # Whether it passed on the first try without correctionlatency_s: float # Single-round end-to-end latency in secondsoutput_tokens: int # Number of output tokensdef summarize(records: list[RunRecord]) -> dict:total = len(records)if total == 0:raise ValueError("Records are empty, cannot calculate statistics")return {"Pass Rate": sum(r.passed for r in records) / total,"First-Try Pass Rate": sum(r.first_try for r in records) / total,"Average Latency (s)": mean(r.latency_s for r in records),"Average Output Rate (token/s)": mean(r.output_tokens / r.latency_s for r in records if r.latency_s > 0),}if __name__ == "__main__":sample = [RunRecord(True, True, 42.0, 1800),RunRecord(True, False, 75.5, 2400),RunRecord(False, False, 60.2, 2100),]for key, value in summarize(sample).items():print(f"{key}: {value:.3f}")
Three points to note during evaluation. First, use the same construction guidance documents and acceptance criteria to ensure a fair comparison. Second, run each model enough times to avoid misjudgments from a single result. Third, factor rework costs into the total time, because a model that passes on the first try often saves more time than a faster model that requires repeated corrections.
7. Common Collaboration Patterns
In actual projects, several typical patterns can be combined:
- Large planning, small execution: The large model outputs the construction document, small models implement modules in parallel, and the large model or humans handle final review.
- Small model batch processing: For homogeneous tasks like batch-adding unit tests or unifying code styles, use small models for centralized processing.
- Human acceptance gate: Set an acceptance point at the end of each stage, proceeding to the next stage only after passing tests and inspections, to prevent errors from accumulating layer by layer.
8. Risks and Precautions
Collaborative development also introduces new risks that need to be mitigated in advance:
- Keys and sensitive information: Do not write access credentials into construction documents or prompts. Credentials should be injected via environment variables or key management services.
- Code export scope: When involving unpublished core code or user data, confirm data processing regulations first and comply with relevant compliance requirements.
- Output review: Code generated by small models must pass tests and static analysis before being merged into the main branch.
- Dependency management: Restrict the model’s permission to introduce new dependencies; all new dependencies require manual confirmation of license and security.
- Version tracking: Record the model version, construction document version, and test results used for each task to facilitate problem tracing.
9. Implementation Recommendations
Teams can advance large and small model collaborative development through the following steps:
- Review development tasks from the past three months and classify them by complexity and repetitiveness.
- Write standardized construction guidance templates for each task category, specifying architecture, interfaces, testing boundaries, and acceptance criteria.
- Select three to five representative tasks to comparatively evaluate candidate model combinations using uniform metrics.
- Determine the default pairing based on evaluation results, while retaining a manual switch path for special tasks.
- Review rework rates and average latency monthly, continuously optimizing the construction document templates.
By following this process, teams can replace subjective judgments with quantifiable data, making model selection serve delivery quality and development efficiency.
