pub struct ConsistencyDef {
pub model: String,
pub k: u32,
pub threshold: f64,
}Expand description
Configuration for a self-consistency uncertainty gate: resample the original request k times
on the same model and score the candidate by agreement with the fresh samples.
Research basis: Wang et al. 2022 (self-consistency) and Farquhar et al., Nature 2024 (semantic entropy). Answers a model reliably reproduces are far likelier correct; disagreement flags hallucination. This produces a continuous confidence score the conformal threshold machinery can calibrate.
maker == checker is intentional — unlike a judge gate, self-consistency is definitionally self-referential. This is the mechanism, not a bug.
Fields§
§model: StringThe model used for resampling, as provider/model. May equal the candidate’s model —
self-consistency is self-referential by design.
k: u32Number of resample calls. Must be in [2, 8]; defaults to 3.
threshold: f64Pass iff the mean agreement score ≥ this threshold, in [0, 1].
Trait Implementations§
Source§impl Clone for ConsistencyDef
impl Clone for ConsistencyDef
Source§fn clone(&self) -> ConsistencyDef
fn clone(&self) -> ConsistencyDef
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more