Skip to main content
QUICK REVIEW

[論文レビュー] CodeIE: Large Code Generation Models are Better Few-Shot Information Extractors

Peng Li, Tianxiang Sun|arXiv (Cornell University)|May 9, 2023
Topic Modeling被引用数 9
ひとこと要約

CodeIE は NER および RE をコード生成の課題として再定式化し、Code-LLMs を用いたコードスタイルのプロンプトで UIE と NL-LLMs を超える少数ショット IE パフォーマンスを達成する。検証された設定の中で Codex のコードプロンプトが最良の結果を生む。

ABSTRACT

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.

研究の動機と目的

  • 大規模モデルを活用した少数ショット情報抽出(IE)をコードベースの出力と Code-LLMs で動機づける。
  • NER および RE のコード生成の定式化を提案し、Code-LLMs の事前学習と整合させる。
  • コードスタイルのプロンプトが微調整済み IE モデルおよび NL-LLMs と比較して少数ショット設定で優れていることを示す。
  • パフォーマンス向上の理由を説明するために、形式の一貫性とモデル忠実度の分析を提供する。

提案手法

  • NER 出力を 'text' と 'type' のキーを持つ Python 辞書のリストとして定式化。
  • RE 出力を 'rel_type','ent1_type','ent1_text','ent2_type','ent2_text' のキーを持つ Python 辞書のリストとして定式化。
  • 入力 x を docstring を持つ Python 関数にラップし、出力を収集する空のリストを利用; Code-LLMs に対してリストへ辞書を追加するよう促す。
  • テストプロンプトの前に、(x^c, y^c) のペアを複数連結してコンテキストデモンストレーションとして使用。
  • コードスタイルおよび自然言語プロンプトの両方を用いて、Code-LLMs(Codex)と NL-LLMs(GPT-3)を少数ショット設定で検証。
  • 構造忠実度、形式的一貫性、意味的忠実度を分析してパフォーマンス向上を理解する。

実験結果

リサーチクエスチョン

  • RQ1コードスタイルのプロンプトを用いた Code-LLMs は少数ショット設定で NER および RE を効果的に実行できるか。
  • RQ2同一の LLM でコード形式の出力は事前学習との整合性を高め、テキスト形式の出力と比べて構造的誤りを減らすか。
  • RQ3Code-LLMs は少数ショット IE タスクにおいて NL-LLMs および微調整済み IE モデルより優れているか。
  • RQ4形式の一貫性や忠実度など、どの要因が CodeIE のパフォーマンス向上に最も寄与するか。

主な発見

  • Code-LLMs はコードプロンプトを用いると UIE(微調整済み IE モデル)および NL-LLMs を少数ショット設定で上回り、7つの IE ベンチマークで優れた性能を示す。
  • 同じ LLM に対して、コードプロンプトはテキストプロンプトよりも良い性能を発し、フォーマット(コードスタイル)がプロンプト内容以上の利得を生むことを示す。
  • Codex(Code-LLM)は、同様のプロンプティング条件下で GPT-3(NL-LLM)をNER および RE の両タスクで概して上回る。
  • コードプロンプトは出力の構造忠実度が高く、テキストプロンプトと比べて構造的誤りがほぼゼロに近い。
  • CodeIE は Codex とコードプロンプトを用いることでベンチマーク全体で最良の平均結果を達成し、少数ショット設定で強力なベースラインを上回る。
  • コードの事前学習適合性と高い忠実度が、少数ショット IE の性能向上に寄与している。

より良い研究を、今すぐ始めましょう

論文設計から論文執筆まで、研究時間を劇的に削減しましょう。

クレジットカード登録不要

このレビューはAIが作成し、人間の編集者が確認しました。