[논문 리뷰] CodeIE: Large Code Generation Models are Better Few-Shot Information Extractors
CodeIE는 NER과 RE를 코드 생성 과제로 재정의하고 코드 스타일 프롬프트를 가진 Code-LLMs를 사용하여 UIE 및 NL-LLMs 대비 뛰어난 few-shot IE 성능을 달성한다; 코드 프롬프트를 가진 Codex가 실험 구성 중 최상의 결과를 낳는다.
Large language models (LLMs) pre-trained on massive corpora have demonstrated impressive few-shot learning ability on many NLP tasks. A common practice is to recast the task into a text-to-text format such that generative LLMs of natural language (NL-LLMs) like GPT-3 can be prompted to solve it. However, it is nontrivial to perform information extraction (IE) tasks with NL-LLMs since the output of the IE task is usually structured and therefore is hard to be converted into plain text. In this paper, we propose to recast the structured output in the form of code instead of natural language and utilize generative LLMs of code (Code-LLMs) such as Codex to perform IE tasks, in particular, named entity recognition and relation extraction. In contrast to NL-LLMs, we show that Code-LLMs can be well-aligned with these IE tasks by designing code-style prompts and formulating these IE tasks as code generation tasks. Experiment results on seven benchmarks show that our method consistently outperforms fine-tuning moderate-size pre-trained models specially designed for IE tasks (e.g., UIE) and prompting NL-LLMs under few-shot settings. We further conduct a series of in-depth analyses to demonstrate the merits of leveraging Code-LLMs for IE tasks.
연구 동기 및 목표
- 대형 모델을 활용한 코드 기반 출력 및 Code-LLMs를 통해 few-shot 정보 추출(IE)을 동기부여한다.
- NER 및 RE에 대해 Code-LLMs 전제 학습과 일치하는 코드 생성 형식을 제안한다.
- 코드 스타일 프롬프트가 파인튜닝된 IE 모델 및 NL-LLMs에 비해 few-shot 설정에서 우수함을 시연한다.
- 성능 향상의 원인을 설명하기 위한 형식 일관성 및 모델 충실도에 대한 분석을 제공한다
제안 방법
- NER 출력을 Python 리스트 안의 키가 'text' 와 'type'인 Python 딕셔너리로 공식화한다.
- RE 출력을 Python 리스트 안의 키가 'rel_type','ent1_type','ent1_text','ent2_type','ent2_text'인 Python 딕셔너리로 공식화한다.
- 입력 x를 docstring이 있는 Python 함수로 래핑하고 출력을 수집할 빈 리스트를 사용한다; Code-LLMs가 리스트에 딕셔너리를 추가하도록 유도한다.
- 테스트 프롬프트 전에 여러 쌍 (x^c, y^c) 를 결합하여 보여주듯 in-context demonstrations을 사용한다.
- 프롬프트는 Code-LLMs(Codex)와 NL-LLMs(GPT-3) 모두에서 코드 스타일 프롬프트와 자연어 프롬프트 형식으로 few-shot 설정에서 테스트된다.
- 구조적 충실도, 형식 일관성, 의미적 충실도를 분석하여 성능 향상의 원인을 이해한다
실험 결과
연구 질문
- RQ1Code-LLMs가 코드 스타일 프롬프트로 few-shot 설정에서 NER과 RE를 효과적으로 수행할 수 있는가?
- RQ2같은 LLM에서 코드 포맷 출력이 Code-LLMs의 사전학습과의 정렬을 개선하고 텍스트 형식 출력보다 구조적 오류를 줄이는가?
- RQ3Code-LLMs가 NL-LLMs 및 미세조정된 IE 모델보다 few-shot IE 과제에서 우수한가?
- RQ4형식 일관성, 충실도 등의 요소가 CodeIE의 성능 향상에 얼마나 크게 기여하는가?
주요 결과
- 코드 프롬프트를 가진 Code-LLMs가 UIE(미세조정 IE 모델) 및 NL-LLMs 대비 seven IE 벤치마크에서 few-shot 설정에서 우수한 성능을 보인다.
- 동일 LLM에서 코드 프롬프트가 텍스트 프롬프트보다 더 나은 성능을 낸다. 이는 형식(코드 스타일)이 프롬프트 내용 외의 이득을 주고 있음을 시사한다.
- Codex(Code-LLM)은 유사한 프롬팅에서 GPT-3(NL-LLM)보다 일반적으로 NER과 RE 두 작업에서 우수하다.
- 코드 프롬프트는 출력 구조의 충실도가 더 높고, 텍스트 프롬프트에 비해 거의 구조적 오류가 발생하지 않는다.
- Codex와 코드 프롬프트를 이용한 CodeIE가 벤치마크 전체에서 최상의 평균 결과를 달성하여 few-shot 설정에서 강력한 베이스라인을 능가한다.
- 코드 사전학습 정합성과 더 높은 충실도가 few-shot IE 성능 향상에 기여한다.
더 나은 연구,지금 바로 시작하세요
연구 설계부터 논문 작성까지, 연구 시간을 획기적으로 줄여보세요.
카드 등록 없음 · 무료 플랜 제공
이 리뷰는 AI가 만들고, 인간 에디터가 검토했습니다.