파운데이션 모델 엔지니어링

10.5 Alignment Tax: Trade-off 측정

Alignment tax 는 post-training intervention 때문에 capability, calibration, diversity, latency, cost가 회귀하는 현상입니다. 필연적이지도 보편적인 현상도 아닙니다. 잘 설계한 intervention은 목표 행동과 일부 capability를 함께 개선할 수 있습니다. 이 용어는 frozen baseline과 matched evaluation이 실제 trade-off를 보여 줄 때만 유용합니다.


무엇이 회귀할 수 있는가

  • Capability retention: post-training 분포가 좁으면 code, math, multilingual, long-context, domain, tool 성능이 이동할 수 있습니다.
  • Diversity와 style: 제한된 preference signal을 최적화하면 verbose하거나 templated mode로 응답이 집중될 수 있습니다.
  • Safety calibration: refusal이 안전한 요청까지 넓어지거나, 충분히 포함되지 않은 slice에서 unsafe compliance가 남을 수 있습니다.
  • Confidence calibration: 일부 post-trained model은 특정 평가에서 calibration이 나빠지는 현상이 관찰되었습니다. 예를 들어 GPT-4 report는 post-training 뒤 calibration 변화를 관찰했습니다 [1]. 그렇다고 base model이 본래 calibrated되어 있거나 RLHF가 언제나 calibration을 파괴하거나 annotator가 하나의 보편적 원인이라는 뜻은 아닙니다.

관찰한 metric 변화와 인과 설명을 구분합니다. Calibration은 task, prompt, decoding, confidence extraction, distribution shift에 따라 달라집니다.


원인은 검증할 가설이다

가능한 mechanism에는 narrow-data interference, reward over-optimization, template/length bias, reference drift, optimizer scale, evaluation mismatch가 있습니다. Capability score가 떨어진 이유가 지식 삭제가 아니라 serving format이나 refusal policy 변화일 수도 있습니다.

SFT-only와 preference optimization, 다른 KL/β\beta, replay mixture, adapter와 full update, frozen/updated tokenizer/template, matched inference setting을 ablation합니다. 원인을 단정하기 전에 example과 intermediate metric을 확인합니다.


완화 수단

  1. 작거나 parameter-efficient한 update: interference를 줄일 수 있지만 retention을 보장하지 않습니다.
  2. KL/reference control: policy drift를 제한하되 reference 자체가 적절한지도 관측합니다.
  3. Replay 또는 PTX mixture: 대표적인 general/domain data를 명시적 weight와 evaluation quarantine으로 섞습니다.
  4. Early stopping과 checkpoint selection: training reward가 아니라 multi-objective held-out gate로 고릅니다.
  5. Weight interpolation: 호환 checkpoint 사이를 sweep합니다. Linear connectivity는 보장된 convex basin이 아니라 경험적 조건입니다.
  6. Gradient surgery: protected-task gradient와 충돌을 줄이지만 유한한 probe set이 모든 capability를 span할 수는 없습니다.

Alignment Strategy

Safety Score
Capability Score
Ideal Zone
(Pareto Optimal)
Capability: 75.0
Safety: 52.5
Base Model

이 visualizer는 Pareto trade-off를 설명할 뿐 실제 모델 frontier를 예측하지 않습니다.


안전한 Gradient Projection 의미론

아래 교육용 함수는 두 objective에 동일한 parameter 목록을 사용하고 모든 None gradient를 0(zero) tensor 로 표현합니다. 한 loss가 특정 parameter를 사용하지 않을 때 vector offset이 달라지는 문제를 막습니다. 여전히 두 번의 backward-equivalent gradient 계산이 필요하며 foundation-model scale에서는 너무 비쌀 수 있습니다.

import torch

def flattened_grads(loss, params, retain_graph=False):
    grads = torch.autograd.grad(
        loss,
        params,
        retain_graph=retain_graph,
        allow_unused=True,
    )
    dense = [torch.zeros_like(p) if g is None else g for p, g in zip(params, grads)]
    return dense, torch.cat([g.reshape(-1) for g in dense])

def project_safety_gradient(model, capability_loss, safety_loss, eps=1e-12):
    params = [p for p in model.parameters() if p.requires_grad]
    cap_parts, g_cap = flattened_grads(capability_loss, params, retain_graph=True)
    saf_parts, g_saf = flattened_grads(safety_loss, params)

    denom = torch.dot(g_cap, g_cap)
    if denom <= eps:
        projected = g_saf
    else:
        projected = g_saf - torch.dot(g_saf, g_cap) / denom * g_cap

    offset = 0
    for p in params:
        count = p.numel()
        p.grad = projected[offset:offset + count].view_as(p).clone()
        offset += count
    assert offset == projected.numel()

이는 한 minibatch direction에 대한 projection입니다. Fixed protected suite에서 검증하고 safety learning이 멈추는지 확인하며 더 저렴한 replay·adapter baseline과 비교합니다. Distributed training은 projection 전에 두 objective를 일관되게 reduce해야 합니다.


측정과 Release Gate

Intervention 전 artifact bundle과 evaluation manifest를 고정합니다. Fixed prompt, template, decoding, tool, seed를 사용합니다. Paired confidence interval 또는 정당화한 randomization/bootstrap test, slice minimum, sample count, adjudicated example을 보고합니다.

Target preference/safety, base·domain retention, calibration error와 selective accuracy, response length/entropy, refusal·over-refusal, tool/schema validity, latency, cost, error rate, privacy/security test를 추적합니다. 하나의 weighted average가 아니라 사전에 선언한 constraint로 checkpoint를 고릅니다.

Critical slice가 실패하거나 회귀가 confidence-bound threshold를 넘거나, held-out benefit 없이 reward만 오르거나, artifact compatibility가 바뀌면 중단합니다. Shadow/canary/ramp-up과 automatic window·hysteresis로 승격하고 last-known-good rollback을 보존·연습합니다.


Quizzes

Quiz 1: Alignment tax가 필연적인 하나의 scalar가 아닌 이유는 무엇인가요? Post-training은 여러 objective를 바꾸며 일부를 동시에 개선할 수 있습니다. Tax는 matched baseline에 비해 특정 evaluation에서 관찰한 회귀이지 보편 상수가 아닙니다.

Quiz 2: Calibration 회귀가 annotator가 불확실성을 벌줬다는 증거가 아닌 이유는 무엇인가요? Data, reward, decoding, prompt, distribution shift 등 여러 원인과 양립하는 관찰입니다. Annotator 인과를 확립하려면 그에 맞는 증거나 ablation이 필요합니다.

Quiz 3: Flatten하기 전에 unused gradient를 0으로 바꿔야 하는 이유는 무엇인가요? Capability loss와 safety loss가 서로 다른 parameter를 사용할 수 있습니다. None 항목을 버리면 vector 길이나 offset이 달라지므로 공통 순서 목록에서 zero-fill해야 합니다.

Quiz 4: Reward가 가장 높은 checkpoint를 고르는 방식의 문제는 무엇인가요? Reward는 proxy이며 length/style exploitation으로 오르는 동안 capability, calibration, safety slice, cost가 회귀할 수 있습니다. 사전에 정한 multi-objective held-out gate가 필요합니다.


References

  1. OpenAI. (2023). GPT-4 Technical Report. arXiv:2303.08774.
  2. Ouyang, L., et al. (2022). Training language models to follow instructions with human feedback. arXiv:2203.02155.
  3. Lopez-Paz, D., & Ranzato, M. (2017). Gradient Episodic Memory for Continual Learning. NeurIPS.