Constraint Composition for Topics
Use this skill when a FUDGE decoder must condition on several target words or independent attributes. For topic control, compute (lambda/N) * sum_j log P(w_j | prefix+candidate).
Inputs
- Candidate-to-target probability table.
- Ordered list of target words or attributes.
lambda_valueand whether to normalize byN.
Outputs
- Composed future log score per candidate.
- Audit contributions per candidate and per target.
Workflow
- Ensure every candidate has every target probability.
- Clip probabilities to avoid log(0).
- Compute the target weight.
- Sum weighted log-probability contributions.
- Pass the composed score to the FUDGE rescoring skill.
Validation
Run python tests/test_composition.py.