Explain KV caching and quantization in LLM inference — why do they matter?
KV caching stores the key and value vectors computed for previous tokens so that generating each new token only requires computing attention for that one new token instead of recomputing the whole sequence — without it, autoregressive generation would be quadratically slower. Quantization reduces the precision of weights (from FP16 to INT8 or INT4, for example) to cut memory footprint and increase throughput, trading a small, usually acceptable amount of accuracy for a large reduction in serving cost. Both are what make serving a 70B-parameter model economically viable at all.