[논문 리뷰] COLD Decoding: Energy-based Constrained Text Generation with Langevin Dynamics
COLD decoding은 constrained 텍스트 생성을 Langevin dynamics를 사용하여 에너지 기반 모델에서 샘플링하는 방식으로 다루며, pretrained LMs의 미세 조정 없이도 유연하고 태스크에 구애받지 않는 제약 통합을 가능하게 한다. abductive reasoning, counterfactual story generation, 및 lexically constrained decoding에서 성능이 향상된 것을 보여준다.
Many applications of text generation require incorporating different constraints to control the semantics or style of generated text. These constraints can be hard (e.g., ensuring certain keywords are included in the output) and soft (e.g., contextualizing the output with the left- or right-hand context). In this paper, we present Energy-based Constrained Decoding with Langevin Dynamics (COLD), a decoding framework which unifies constrained generation as specifying constraints through an energy function, then performing efficient differentiable reasoning over the constraints through gradient-based sampling. COLD decoding is a flexible framework that can be applied directly to off-the-shelf left-to-right language models without the need for any task-specific fine-tuning, as demonstrated through three challenging text generation applications: lexically-constrained generation, abductive reasoning, and counterfactual reasoning. Our experiments on these constrained generation tasks point to the effectiveness of our approach, both in terms of automatic and human evaluation.
연구 동기 및 목표
- 제약이 고정된(키워드) 텍스트 생성과 소프트 컨스트레인(맥락)이 다양한 태스크에 대해 제약을 둔다고Motivate constrained text generation where constraints can be hard (keywords) or soft (context) and vary across tasks.
- 다양한 제약 유형을 하나의 에너지 기반 모델(EBM)로 해석하여 디코딩을 샘플링으로 통일한다.
- Langevin dynamics를 사용해 태스크 특이적 미세 조정 없이도 제약에 대한 gradient 기반의 미분 가능 추론을 가능하게 한다.
- 다수의 제약된 생성 태스크에서 이 접근법을 시연하고 기존의 디코딩 방법과 비교한다.
제안 방법
- 제약 디코딩을 텍스트 시퀀스에 대한 p(y) = exp{sum_i lambda_i f_i(y)} / Z의 에너지 기반 분포로의 샘플링으로 공식화한다.
- 이산 텍스트를 연속적 소프트 시퀀스 y~로 완화하고 에너지 E(y~) = -sum_i lambda_i f_i(y~)를 정의한 뒤 Langevin 업데이트 y~(n+1) = y~(n) - eta grad_y~ E(y~(n)) + epsilon^(n) 를 수행한다.
- 연속적 샘플에 주입될 수 있는 미분 가능 제약 함수들(soft fluency, future-context prediction, n-gram similarity)을 정의하여 에너지 함수에 접목한다.
- 언더라이닝 LM에 의해 가이드되는 top-k 필터링으로 소프트를 디스크리트로 매핑하여 연속 샘플에서 유창한 이산 출력을 생성한다.
- LM 기반의 그리디 로짓으로 초기화하고 Langevin dynamics 동안 감소하는 노이즈 스케줄을 적용하며, 원한다면 여러 출력 중에서 선택하는 샘플 앤 트리(샘플링 및 선택)를 수행한다.
- 각 위치에서 top-k LM 후보 중에서 가장 확률이 높은 토큰을 취하는 이산화(discretize) 방법으로, 하드 제약을 만족시키기 위해 제약 토큰을 추가하는 것을 가능하게 한다.
실험 결과
연구 질문
- RQ1에 대한 task 구체적 미세 조정 없이도 일반 언어 모델(off-the-shelf)과 함께 Langevin dynamics를 이용한 제약 디코딩이 작동할 수 있는가?
- RQ2다양한 미분 가능 제약 함수(유창성, 맥락 일관성, n-그램 유사성)가 어떻게 결합되어 다양한 제약 생성을 가능하게 하는가?
- RQ3Cold 디코딩이 abductive reasoning, counterfactual story generation, 및 lexically constrained decoding에서 태스크 특이적이거나 경사 기반 기준선보다 우수한가?
주요 결과
- Cold decoding은 abductive reasoning에서 기저 방법에 비해 어휘 커버리지와 텍스트 일관성이 향상되었다.
- 인간 평가에서 Cold는 좌우 맥락 모두에서 경쟁적 기준선들보다 전반적인 일관성이 더 높게 나타났다.
- Counterfactual story rewriting에서 Cold는 일관성 면에서 더 좋았고 최소 편집 척도에 대해서도 Delorean과 비교해 유사하게 나타났다.
- lexically constrained decoding에서 Cold는 일부 기준선보다 더 높은 키워드 커버리지를 달성하면서도 유창성을 유지하였다.
- 총체적으로 Cold는 태스크를 통합하는 디코딩 프레임워크 내에서 다양한 제약을 처리할 수 있는 능력을 보였으며, 태스크 특이적 미세 조정 없이도 이를 달성한다.
이 논문 읽기
누빈트 뷰어에서 원문을 열고, 읽으면서 궁금한 곳을 바로 물어보세요.
누빈트에서 이 논문 읽기이 리뷰는 AI가 논문 원문을 바탕으로 만들었습니다. 인용하기 전에 원문을 확인해 주세요.