Transformers Engine Invariants
Library version: 4.57.3
Anchor frozen at: 2026-05-06T22:57:22+02:00
Summary: 41 proposed invariants, 41 validation-confirmed cases.
Invariants by extraction source
Static miner (AST analysis) (13)
transformers_dormant_early_stopping_set_true[dormant] — GenerationConfig.minor_issues[key]_=_msg: marks dormant when num_beams == 1 AND early_stopping pr...transformers_dormant_epsilon_cutoff_ne_0_0[dormant] — GenerationConfig.minor_issues[key]_=_msg: marks dormant when epsilon_cutoff present True AND epsi...transformers_dormant_eta_cutoff_ne_0_0[dormant] — GenerationConfig.minor_issues[key]_=_msg: marks dormant when eta_cutoff present True AND eta_cuto...transformers_raises_bnb_4bit_quant_type_not_type_str[error] — BitsAndBytesConfig.raise_TypeError: raises when bnb_4bit_quant_type type_is_not strtransformers_raises_bnb_4bit_use_double_quant_not_type_bool[error] — BitsAndBytesConfig.raise_TypeError: raises when bnb_4bit_use_double_quant type_is_not booltransformers_raises_compile_config_not_type_compileconfig[error] — GenerationConfig.raise_ValueError: raises when compile_config present True AND compile_config typ...transformers_raises_llm_int8_enable_fp32_cpu_offload_not_type_bool[error] — BitsAndBytesConfig.raise_TypeError: raises when llm_int8_enable_fp32_cpu_offload type_is_not booltransformers_raises_llm_int8_has_fp16_weight_not_type_bool[error] — BitsAndBytesConfig.raise_TypeError: raises when llm_int8_has_fp16_weight type_is_not booltransformers_raises_llm_int8_skip_modules_not_type_list[error] — BitsAndBytesConfig.raise_TypeError: raises when llm_int8_skip_modules present True AND llm_int8_s...transformers_raises_llm_int8_threshold_not_type_float[error] — BitsAndBytesConfig.raise_TypeError: raises when llm_int8_threshold type_is_not floattransformers_raises_load_in_4bit_not_type_bool[error] — BitsAndBytesConfig.raise_TypeError: raises when load_in_4bit type_is_not booltransformers_raises_load_in_8bit_not_type_bool[error] — BitsAndBytesConfig.raise_TypeError: raises when load_in_8bit type_is_not booltransformers_raises_num_beams_eq_1[error] — GenerationConfig.raise_ValueError: raises when num_return_sequences != 1 AND num_beams == 1 (drop...
Dynamic miner (constructor probing) (28)
transformers_beam_search_num_beams_eq_1[dormant] — GenerationConfig.validate flagsnum_beams(num beams eq 1)transformers_cache_choice_cache_implementation_not_in_allowlist[error] — GenerationConfig.init flagscache_implementation(cache implementation not in allowlist)transformers_cache_choice_use_cache_eq_false[dormant] — GenerationConfig.validate flagsuse_cache(use cache eq false)transformers_compile_config_type_compile_config_exceeds_zero[error] — GenerationConfig.init flagscompile_config(compile config exceeds zero)transformers_compile_config_type_compile_config_type_not_in_CompileConfig[error] — GenerationConfig.init flagscompile_config(compile config type not in CompileConfig)transformers_early_stopping_type_early_stopping_exceeds_zero[error] — GenerationConfig.init flagsearly_stopping(early stopping exceeds zero)transformers_early_stopping_type_early_stopping_not_in_allowlist[error] — GenerationConfig.init flagsearly_stopping(early stopping not in allowlist)transformers_early_stopping_type_early_stopping_type_not_in_bool_or_int_or_str[error] — GenerationConfig.init flagsearly_stopping(early stopping type not in bool or int or str)transformers_greedy_strips_epsilon_cutoff[dormant] — GenerationConfig.validate() records dormantepsilon_cutoffwhen do_sample=False and `epsilon_cu...transformers_greedy_strips_eta_cutoff[dormant] — GenerationConfig.validate() records dormanteta_cutoffwhen do_sample=False andeta_cutoffis...transformers_greedy_strips_min_p[dormant] — GenerationConfig.validate() records dormantmin_pwhen do_sample=False andmin_pis set to a ...transformers_greedy_strips_temperature[dormant] — GenerationConfig.validate() records dormanttemperaturewhen do_sample=False andtemperature...transformers_greedy_strips_top_k[dormant] — GenerationConfig.validate() records dormanttop_kwhen do_sample=False andtop_kis set to a ...transformers_greedy_strips_top_p[dormant] — GenerationConfig.validate() records dormanttop_pwhen do_sample=False andtop_pis set to a ...transformers_greedy_strips_typical_p[dormant] — GenerationConfig.validate() records dormanttypical_pwhen do_sample=False andtypical_pis s...transformers_negative_pad_token_id[dormant] — GenerationConfig.validate() records dormant pad_token_id < 0transformers_no_return_dict_strips_output_attentions[dormant] — GenerationConfig.validate() records dormantoutput_attentionswhen return_dict_in_generate=Fals...transformers_no_return_dict_strips_output_hidden_states[dormant] — GenerationConfig.validate() records dormantoutput_hidden_stateswhen return_dict_in_generate=F...transformers_no_return_dict_strips_output_scores[dormant] — GenerationConfig.validate() records dormantoutput_scoreswhen return_dict_in_generate=False an...transformers_num_return_vs_beams_do_sample_eq_false_and_num_beams_eq_1[error] — GenerationConfig.init flagsnum_beams(do sample eq false and num beams eq 1)transformers_num_return_vs_beams_num_beams_lt_num_return_sequences[error] — GenerationConfig.init flagsnum_beams(num beams lt num return sequences)transformers_num_return_vs_beams_num_beams_not_divisible_by_num_return_sequences[error] — GenerationConfig.init flagsnum_beams(num beams not divisible by num return sequences)transformers_output_token_ids_max_new_tokens_le_zero[error] — GenerationConfig.init flagsmax_new_tokens(max new tokens le zero)transformers_output_token_ids_max_new_tokens_not_in_allowlist[error] — GenerationConfig.init flagsmax_new_tokens(max new tokens not in allowlist)transformers_output_token_ids_pad_token_id_not_in_allowlist[dormant] — GenerationConfig.validate flagspad_token_id(pad token id not in allowlist)transformers_single_beam_strips_early_stopping[dormant] — GenerationConfig.validate() records dormantearly_stoppingwhen num_beams=1 and `early_stopping...transformers_single_beam_strips_length_penalty[dormant] — GenerationConfig.validate() records dormantlength_penaltywhen num_beams=1 and `length_penalty...transformers_watermarking_type_watermarking_config_type_not_in_WatermarkingConfig[error] — GenerationConfig.init flagswatermarking_config(watermarking config type not in Watermarki...