Code Generation: Loss of Logical Coherence

For tasks like code generation, 2-bit quantization often leads to models producing syntactically correct but logically incoherent or 'broken' code, struggling to maintain the precise reasoning required for functional outputs, unlike 4-bit models which can perform well.

The top 3

  1. 2-Bit Quantization: Up to 7.94% Accuracy Drop in Code Generation: Benchmarking shows a significant performance cliff for 2-bit quantized LLMs in coding tasks, with one study noting a 7.94% accuracy drop for Mistral-7B-Instruct-v0.2 compared to 4-bit, making 2-bit risky for production where accuracy is critical. While 4-bit can achieve 98.9% accuracy in coding, sub-4-bit quantization (like 2-bit) regresses sharply on most current architectures, particularly for complex reasoning and math benchmarks.
  2. Common 2-Bit Code Failures: API Misuse & Assertion Errors: When models are quantized to 2-bit, they frequently fail in code generation due to issues like assertion errors or calls to non-existent APIs, indicating a loss of logical coherence and semantic understanding. This degradation is more pronounced in coding and math tasks compared to open-ended generation, as precision loss directly impacts the model's ability to maintain complex logical dependencies and generate functionally correct code.
  3. 2-Bit Perplexity: Catastrophic Increases Exceeding 1000: The extreme compression of 2-bit quantization often leads to 'catastrophic failure' in LLMs, evidenced by perplexity increases exceeding 1000, indicating a severe loss in the model's ability to predict text coherently. This degradation is attributed to two failure modes: 'Signal Degradation,' where information precision is impaired, and 'Computation Collapse,' where key components fail to function, preventing correct information processing in early layers.

Sources

Open the full topic