Entropic 2.3.8
Local-first agentic inference engine
Loading...
Searching...
No Matches
entropic::LogprobResult Struct Reference

Per-token log-probability evaluation result. More...

#include <entropic/types/logprob_result.h>

Public Attributes

std::vector< float > logprobs
 Log-prob for each token transition (N-1 values)
 
std::vector< int32_t > tokens
 Input tokens echoed back for verification.
 
float perplexity = 0.0f
 exp(-mean(logprobs)) — lower = less surprising
 
float total_logprob = 0.0f
 Sum of all logprob values.
 
int n_tokens = 0
 Number of input tokens.
 
int n_logprobs = 0
 Number of logprob values (n_tokens - 1)
 

Detailed Description

Per-token log-probability evaluation result.

Produced by InferenceBackend::evaluate_logprobs(). The base class computes perplexity and total_logprob from the raw logprobs returned by the backend implementation.

Version
1.9.10

Definition at line 36 of file logprob_result.h.

Member Data Documentation

◆ logprobs

std::vector<float> entropic::LogprobResult::logprobs

Log-prob for each token transition (N-1 values)

Definition at line 37 of file logprob_result.h.

◆ n_logprobs

int entropic::LogprobResult::n_logprobs = 0

Number of logprob values (n_tokens - 1)

Definition at line 42 of file logprob_result.h.

◆ n_tokens

int entropic::LogprobResult::n_tokens = 0

Number of input tokens.

Definition at line 41 of file logprob_result.h.

◆ perplexity

float entropic::LogprobResult::perplexity = 0.0f

exp(-mean(logprobs)) — lower = less surprising

Definition at line 39 of file logprob_result.h.

◆ tokens

std::vector<int32_t> entropic::LogprobResult::tokens

Input tokens echoed back for verification.

Definition at line 38 of file logprob_result.h.

◆ total_logprob

float entropic::LogprobResult::total_logprob = 0.0f

Sum of all logprob values.

Definition at line 40 of file logprob_result.h.


The documentation for this struct was generated from the following file: