Cross model candidate pool

From wenmin-wu/ds-skills · View interactive version

Cross model candidate pool is an AI agent skill from the GitHub repository wenmin-wu/ds-skills. Merge candidate pools from multiple independent seq2seq models before MBR selection to reduce shared failure modes

How to use this skill

Skill file

Cross-Model Candidate Pool

Overview

Single-model MBR candidates share the same biases. Run 2+ independent models (different architectures or checkpoints), merge their candidate pools, then apply MBR on the combined pool. Reduces correlated errors and improves consensus quality.

Quick Start

def cross_model_mbr(models, tokenizer, input_ids, attn_mask, mbr_fn):
    combined_pool = []
    for model in models:
        candidates = generate_diverse_candidates(model, tokenizer, input_ids, attn_mask)
        combined_pool.extend(candidates)
        # Unload model to free GPU memory
        model.cpu()
        del model
        torch.cuda.empty_cache()
    return mbr_fn(combined_pool)

Key Decisions

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.