Cognition · Software component
Test-Based Vote Aggregator
Software componentCognitionCognition & Memoryarc:TestBasedVoteAggregator
A self-consistency aggregator for generated code that executes each sampled implementation against provided test cases and selects among the samples that pass, instead of comparing output text.
Responsibility. Selects consensus code solutions by test-execution outcomes.
Also known as: Test-driven aggregation, Execution-based voting
Variant of Self-Consistency Aggregator abstract
When to choose. Choose for code generation where implementations vary textually but test cases define correctness.
Relationships
invokes dependency
reads dependency
alternative to variability
Quantitative guidance
As stated by the sources; verify before use.
- k=5 with consensus selection improved HumanEval correctness by 28%; 76% vs 59% of internal tasks passed all tests; consensus code rated more readable 64% of the time (Ch5.3).
Classification
- Patterns
- Test-based voting
- Quality attributes
- Functional suitability: correctness and validity (ISO/IEC 25010 | NIST AI RMF: valid)Maintainability (ISO/IEC 25010)
- Risks mitigated
- Syntactically invalid generated codeEdge-case logic errors
Sources
- Ch5.3: T. Nguyen, "Self-Consistency Fundamentals," in Mastering Agentic AI Systems: Guide for the NVIDIA NCP-AAI Exam, 1st ed. 2026, ch. 5.3. ISBN: 9798244538229.