pub struct TTTConfig {Show 15 fields
pub learning_rate: f64,
pub gradient_steps: u32,
pub max_grad_norm: f64,
pub min_input_length: u32,
pub max_ttt_context: u32,
pub enabled: bool,
pub tau_skip: f32,
pub tau_light: f32,
pub tau_heavy: f32,
pub tau_reject: f32,
pub delta_min: f32,
pub adaptive_steps: bool,
pub max_adaptation_ms: u64,
pub max_gradient_steps: usize,
pub pending_rollback_ms: u64,
}Expand description
Configuration for Test-Time Training
Fields§
§learning_rate: f64Learning rate for TTT adaptation Higher than fine-tuning since we do few steps Recommended: 1e-4 to 5e-4
gradient_steps: u32Number of gradient steps per input More steps = better adaptation but higher latency Recommended: 1-5
max_grad_norm: f64Maximum gradient norm for clipping
min_input_length: u32Minimum input length (tokens) to trigger TTT Short inputs don’t benefit from adaptation
max_ttt_context: u32Maximum input length to process for TTT Truncates very long inputs to control latency
enabled: boolWhether TTT is enabled
tau_skip: f32Perplexity threshold below which adaptation is skipped (input already well-modeled)
tau_light: f32Perplexity threshold for light adaptation (1 step)
tau_heavy: f32Perplexity threshold for heavy adaptation (3 steps)
tau_reject: f32Perplexity ceiling above which adaptation is skipped (likely adversarial/garbage input). Very high perplexity indicates the input is far from the model’s training distribution and gradient steps would be noise or potentially adversarial weight poisoning.
delta_min: f32Minimum loss improvement to consider adaptation beneficial (confidence gate)
adaptive_steps: boolWhether to use adaptive step counts based on perplexity
max_adaptation_ms: u64Maximum wall-clock time for a single TTT adaptation pass (milliseconds). When using ZMQ RPC (default timeout 30s), the default leaves headroom for serialization, network transfer, and response processing.
max_gradient_steps: usizeHard ceiling on gradient steps per request, regardless of client override. Prevents unbounded compute from malicious or misconfigured clients.
pending_rollback_ms: u64Auto-rollback timeout for pending adaptations (milliseconds). After a non-auto-commit training, the server holds the pre-adaptation snapshot for this long before auto-rolling back. Increase for interactive workflows (MCP, human-in-the-loop); decrease for programmatic API clients.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TTTConfig
impl<'de> Deserialize<'de> for TTTConfig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TTTConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<TTTConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for TTTConfig
impl Serialize for TTTConfig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for TTTConfig
impl RefUnwindSafe for TTTConfig
impl Send for TTTConfig
impl Sync for TTTConfig
impl Unpin for TTTConfig
impl UnsafeUnpin for TTTConfig
impl UnwindSafe for TTTConfig
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request