Three Key Parameters for Improving Output Quality in Multi-Agent Systems
This article breaks down three parameters that drive output quality in multi-agent content generation: constraint strength, context passing, and the verification loop. It explains why longer prompts do not reduce quality variance, how to structure hard constraints so they can be machine-checked, how to hand off structured context instead of full history, and how to close the loop with objective review criteria and clear termination conditions. It also covers a recommended tuning order, common failure modes, and infrastructure options for running such a pipeline.
1. Background: Why a Longer Prompt Does Not Mean Higher Quality
In multi-agent workflows that produce content, a common mistake is packing every expectation into one long prompt: the topic, the tone, the word count, and the structure all at once. The result is diluted model attention, output that swings between too long and too short, drifting style, and factual statements that contradict each other.
From an engineering perspective, quality variance in content generation tasks comes from three sources of uncertainty:
- Uncertain task boundaries: the agent does not know what it must do and what it must never do.
- Uncertain context: information from upstream steps gets compressed, rewritten, or lost in transit.
- Uncertain results: there are no executable acceptance criteria, so errors are only caught by human review.
The leverage point is therefore not prompt length. It is making these three uncertainties parameterized, measurable, and regression-testable. The three parameters below map to those three layers.
2. Parameter One: Constraint Strength
2.1 Definition and a Common Misconception
Constraint strength is the ratio of hard requirements to soft suggestions in a task description, and whether the hard requirements can be judged by a machine. Low constraint strength looks like “try to be professional” or “make it vivid.” High constraint strength looks like “the body contains three H2 sections, each with at least 150 words, and no number appears without a cited source.”
The misconception is equating constraint strength with word count. What actually matters is decidability: a constraint that cannot be evaluated as true or false by a rule or by another agent effectively does not exist during generation.
2.2 Layered Structure
Split constraints into three layers so they do not conflict with each other:
- Structure layer: number of sections, heading levels, whether code blocks or lists are allowed.
- Semantic layer: audience, terminology density, argumentation style, points that must be covered.
- Forbidden layer: types of statements that must not appear, data and citations that must not be fabricated.
Illustrative configuration:
task_spec:structure:sections: 4min_chars_per_section: 200allow_code_block: truesemantics:audience: "developers with 3+ years of experience"must_cover: ["parameter definitions", "configuration examples", "evaluation methods"]forbidden:- "specific performance numbers without a source"- "unverified product capability claims"
2.3 Coupling With the Other Parameters
Constraints that are too strong compress the generation space and produce templated output; constraints that are too weak produce high variance. In practice, starting with 5 to 8 hard constraints and adjusting based on evaluation results is more stable than writing 20 constraints up front.
3. Parameter Two: Context Passing
3.1 The Cost of Passing Everything
In a multi-agent pipeline, a planner, a writer, and a reviewer run in sequence. If every step passes the full history downstream, two problems appear: irrelevant information interferes with the current decision, and key information gets “lost in the middle” of a long context.
3.2 Structured Handoff
A more reliable approach is to define an explicit handoff data structure and pass only the fields the downstream step actually needs:
{"outline": ["background", "parameter one", "parameter two", "parameter three", "conclusion"],"decisions": ["target audience is developers", "include illustrative code"],"open_questions": ["whether an evaluation baseline is needed"],"style_tokens": {"terminology_density": "medium-high", "sentence_length": "medium"}}
Three points matter here: the handoff must be structured fields rather than free text; unresolved questions from upstream must be passed downstream explicitly so they are not silently dropped; and style information should be expressed as enumerable tags to reduce ambiguity.
3.3 Tuning the Passing Granularity
Context can be passed in layers as “summary plus key excerpts”: pass the summary by default, and pull the original excerpts on demand when the downstream task involves detail verification. This keeps context length under control while preserving traceability.
4. Parameter Three: The Verification Loop
4.1 From Single-Shot Generation to a Closed Loop
Single-shot generation has a ceiling on expected quality, and a closed verification loop is what breaks through it. The basic form is an independent agent that checks the output against the task constraints item by item, returns non-compliant items as a structured issue list, and has the writer revise in a targeted way.
4.2 Designing the Check Items
Check items should be as objective as possible, for example:
- Structural completeness: whether all required sections are present.
- Constraint hit rate: each hard requirement checked off individually.
- Factual caution: whether unsourced specific numbers or capability promises appear.
- Repetition: whether large passages duplicate already generated sections.
4.3 Iteration Count and Termination Conditions
The loop needs an explicit termination condition, otherwise revision can go on indefinitely. A common combination is “maximum rounds plus a remaining-issue threshold,” for example at most 3 rounds, ending when zero severe issues remain. Also record how the issue count changes each round to tell whether the problem lies in the parameters or in model capability.
Illustrative pseudocode:
for round in range(MAX_ROUNDS):draft = writer.generate(spec, context)issues = reviewer.check(draft, spec)if len(issues) == 0:breakcontext = merge(context, issues)
5. Recommended Tuning Order for the Three Parameters
The recommended order is: fix constraint strength first, then optimize context passing, and introduce the verification loop last. The reason is that the verification loop amplifies upstream defects — if the task constraints themselves are vague, the reviewer’s judgments will also waver, causing revisions to oscillate back and forth.
Keep a fixed evaluation set during tuning: pick 10 to 20 representative content tasks, change one parameter at a time, and record three metrics — structural compliance rate, constraint hit rate, and human readability score — to form a regression baseline.
6. Common Failure Modes and How to Diagnose Them
- Templated output: too many constraints and no semantic-layer guidance; reduce hard items and add audience description.
- Style drift: no style tags in the handoff; switch to enumerated style fields.
- Revision oscillation: subjective check items and no termination condition; switch to objective checks and set a round limit.
- Factual risk: no forbidden layer; explicitly prohibit unsourced numbers and capability promises.
7. Implementation Notes
If the overall solution runs in the cloud, general-purpose service categories can carry the engineering requirements: object storage for evaluation sets and generated artifacts, a message queue to decouple agent tasks, a container platform for runtime elasticity, and logging plus monitoring and alerting to observe how the issue count changes each round. Baidu AI Cloud offers corresponding capabilities in these general categories and can serve as one infrastructure option when building such a pipeline.
Overall, improving quality in a content-generation multi-agent system comes down to turning “does this feel well written” into “are the parameters controllable and are the results decidable.” The three parameters, combined with a fixed evaluation set and a regression process, are what turn quality improvement from an accident into a reproducible engineering result.
