Skip to main content

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 str
  • transformers_raises_bnb_4bit_use_double_quant_not_type_bool [error] — BitsAndBytesConfig.raise_TypeError: raises when bnb_4bit_use_double_quant type_is_not bool
  • transformers_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 bool
  • transformers_raises_llm_int8_has_fp16_weight_not_type_bool [error] — BitsAndBytesConfig.raise_TypeError: raises when llm_int8_has_fp16_weight type_is_not bool
  • transformers_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 float
  • transformers_raises_load_in_4bit_not_type_bool [error] — BitsAndBytesConfig.raise_TypeError: raises when load_in_4bit type_is_not bool
  • transformers_raises_load_in_8bit_not_type_bool [error] — BitsAndBytesConfig.raise_TypeError: raises when load_in_8bit type_is_not bool
  • transformers_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 flags num_beams (num beams eq 1)
  • transformers_cache_choice_cache_implementation_not_in_allowlist [error] — GenerationConfig.init flags cache_implementation (cache implementation not in allowlist)
  • transformers_cache_choice_use_cache_eq_false [dormant] — GenerationConfig.validate flags use_cache (use cache eq false)
  • transformers_compile_config_type_compile_config_exceeds_zero [error] — GenerationConfig.init flags compile_config (compile config exceeds zero)
  • transformers_compile_config_type_compile_config_type_not_in_CompileConfig [error] — GenerationConfig.init flags compile_config (compile config type not in CompileConfig)
  • transformers_early_stopping_type_early_stopping_exceeds_zero [error] — GenerationConfig.init flags early_stopping (early stopping exceeds zero)
  • transformers_early_stopping_type_early_stopping_not_in_allowlist [error] — GenerationConfig.init flags early_stopping (early stopping not in allowlist)
  • transformers_early_stopping_type_early_stopping_type_not_in_bool_or_int_or_str [error] — GenerationConfig.init flags early_stopping (early stopping type not in bool or int or str)
  • transformers_greedy_strips_epsilon_cutoff [dormant] — GenerationConfig.validate() records dormant epsilon_cutoff when do_sample=False and `epsilon_cu...
  • transformers_greedy_strips_eta_cutoff [dormant] — GenerationConfig.validate() records dormant eta_cutoff when do_sample=False and eta_cutoff is...
  • transformers_greedy_strips_min_p [dormant] — GenerationConfig.validate() records dormant min_p when do_sample=False and min_p is set to a ...
  • transformers_greedy_strips_temperature [dormant] — GenerationConfig.validate() records dormant temperature when do_sample=False and temperature ...
  • transformers_greedy_strips_top_k [dormant] — GenerationConfig.validate() records dormant top_k when do_sample=False and top_k is set to a ...
  • transformers_greedy_strips_top_p [dormant] — GenerationConfig.validate() records dormant top_p when do_sample=False and top_p is set to a ...
  • transformers_greedy_strips_typical_p [dormant] — GenerationConfig.validate() records dormant typical_p when do_sample=False and typical_p is s...
  • transformers_negative_pad_token_id [dormant] — GenerationConfig.validate() records dormant pad_token_id < 0
  • transformers_no_return_dict_strips_output_attentions [dormant] — GenerationConfig.validate() records dormant output_attentions when return_dict_in_generate=Fals...
  • transformers_no_return_dict_strips_output_hidden_states [dormant] — GenerationConfig.validate() records dormant output_hidden_states when return_dict_in_generate=F...
  • transformers_no_return_dict_strips_output_scores [dormant] — GenerationConfig.validate() records dormant output_scores when return_dict_in_generate=False an...
  • transformers_num_return_vs_beams_do_sample_eq_false_and_num_beams_eq_1 [error] — GenerationConfig.init flags num_beams (do sample eq false and num beams eq 1)
  • transformers_num_return_vs_beams_num_beams_lt_num_return_sequences [error] — GenerationConfig.init flags num_beams (num beams lt num return sequences)
  • transformers_num_return_vs_beams_num_beams_not_divisible_by_num_return_sequences [error] — GenerationConfig.init flags num_beams (num beams not divisible by num return sequences)
  • transformers_output_token_ids_max_new_tokens_le_zero [error] — GenerationConfig.init flags max_new_tokens (max new tokens le zero)
  • transformers_output_token_ids_max_new_tokens_not_in_allowlist [error] — GenerationConfig.init flags max_new_tokens (max new tokens not in allowlist)
  • transformers_output_token_ids_pad_token_id_not_in_allowlist [dormant] — GenerationConfig.validate flags pad_token_id (pad token id not in allowlist)
  • transformers_single_beam_strips_early_stopping [dormant] — GenerationConfig.validate() records dormant early_stopping when num_beams=1 and `early_stopping...
  • transformers_single_beam_strips_length_penalty [dormant] — GenerationConfig.validate() records dormant length_penalty when num_beams=1 and `length_penalty...
  • transformers_watermarking_type_watermarking_config_type_not_in_WatermarkingConfig [error] — GenerationConfig.init flags watermarking_config (watermarking config type not in Watermarki...