A computer-readable medium having stored thereon instructions adapted to be executed by a processor, the instructions which, when executed, cause the processor to perform a method for operating an internal combustion engine, the method including:
- specifying a setpoint value for a variable characterizing an air/fuel mixture in at least one operating state of the internal combustion engine;
- ascertaining a value of at least one variable characterizing a quality of combustion;
- comparing the ascertained value for the at least one variable characterizing the quality of the combustion to a first specified threshold value;
- and
- correcting the setpoint value if the ascertained value for the at least one variable characterizing the quality of the combustion deviates from the first specified threshold value by an amount that exceeds a second specified threshold value.