[論文レビュー] Towards Optimizing the Costs of LLM Usage
本稿では、モデルを起動せずに出力品質を推定することで、LLM使用コストを削減するQC-Optというフレームワークを提案する。LLM選択と入力トークン長の最適化を実施することで、品質に配慮したLLMルーティング、トークン最適化ヒューリスティクス、ナップサックに基づくヒューリスティクス適用戦略により、40–90%のコスト削減と4–7%の品質向上を達成した。
Generative AI and LLMs in particular are heavily used nowadays for various document processing tasks such as question answering and summarization. However, different LLMs come with different capabilities for different tasks as well as with different costs, tokenization, and latency. In fact, enterprises are already incurring huge costs of operating or using LLMs for their respective use cases. In this work, we propose optimizing the usage costs of LLMs by estimating their output quality (without actually invoking the LLMs), and then solving an optimization routine for the LLM selection to either keep costs under a budget, or minimize the costs, in a quality and latency aware manner. We propose a model to predict the output quality of LLMs on document processing tasks like summarization, followed by an LP rounding algorithm to optimize the selection of LLMs. We study optimization problems trading off the quality and costs, both theoretically and empirically. We further propose a sentence simplification model for reducing the number of tokens in a controlled manner. Additionally, we propose several deterministic heuristics for reducing tokens in a quality aware manner, and study the related optimization problem of applying the heuristics optimizing the quality and cost trade-off. We perform extensive empirical validation of our methods on not only enterprise datasets but also on open-source datasets, annotated by us, and show that we perform much better compared to closest baselines. Our methods reduce costs by 40%- 90% while improving quality by 4%-7%. We will release the annotated open source datasets to the community for further research and exploration.
研究の動機と目的
- ドキュメント処理タスク(要約や質問応答など)におけるLLM使用の高額かつ変動しやすいコストを軽減すること。
- モデルを起動せずにLLM出力品質を推定することで、コスト効率の良いルーティング意思決定を可能にすること。
- コストを最小限に抑えつつ品質や遅延を維持または向上させるために、LLM選択と入力トークン数の両方を最適化すること。
- 品質劣化を制御し、トークン節約を最大化するように、ヒューリスティクスを用いた入力長短縮パイプラインを開発すること。
- 企業およびオープンソースデータセット上でフレームワークを実証的に検証し、コスト削減と品質向上を示すこと。
提案手法
- モデルを実行せずに要約タスクにおけるLLM出力品質を予測するためのカスタム損失関数を用いた品質推定モデルを提案する。
- コスト、品質、遅延制約の下でLLM選択問題を解くためのLPラウンディングアルゴリズムを導入する。
- 停止語の削除や略語の簡略化などの8つの決定的ヒューリスティクスを用いて、入力長を短縮するトークン最適化モジュールを設計する。
- 各文に対してヒューリスティクスの最適適用をナップサック問題としてモデル化し、品質劣化をコスト、トークン節約を利益とする。
- 各文ごとのヒューリスティクスの最適な適用順序を決定するために、小規模なヒューリスティクス集合に対してブルートフォースを用いる。
- 予測された品質とコスト制約に基づき、最適なLLMを選択し、トークン最適化を適用するスマートルーターを採用する。
実験結果
リサーチクエスチョン
- RQ1モデルを起動せずにLLM出力品質を正確に予測できるか。これにより、コスト効率の良いルーティングが可能になるか。
- RQ2コストを最小限に抑えつつ品質を維持するため、LLM選択と入力トークン長をどのように共同最適化できるか。
- RQ3ヒューリスティクスベースの圧縮を適用する際の、トークン短縮と品質劣化のトレードオフは何か。
- RQ4ナップサックに基づく定式化は、ヒューリスティクス適用の最適化を効果的に導けるか。
- RQ5多様なドキュメント処理タスクにおいて、提案手法はベースラインと比較してコスト、品質、遅延の観点でどのように優れているか。
主な発見
- 提案されたQC-Optフレームワークは、企業およびオープンデータセットでLLM使用コストを40–90%削減するとともに、出力品質を4–7%向上させた。
- 品質推定モデルにより、実際の推論を実行せずにLLMのパフォーマンスを正確に予測でき、実行時のコストと遅延を削減した。
- ヒューリスティクスを用いたトークン最適化により、要約データセットで最大22.07%の圧縮が達成され、品質劣化を制御した。
- ナップサックに基づくヒューリスティクス適用戦略により、ブルートフォースによるヒューリスティクス適用と比較して、品質劣化を30–50%削減した。
- Text-Curieのような高速で安価なモデルに多数のクエリをルーティングしたことで、遅延が約13%削減された。
- ユーザースタディーの結果、人間の出力品質への認識がBertScoreなどの自動指標と一致しており、モデルの予測精度が妥当であることが裏付けられた。
より良い研究を、今すぐ始めましょう
論文の読解から最終レビューまで、研究時間を劇的に削減しましょう。
クレジットカード登録不要
このレビューはAIが作成し、人間の編集者が確認しました。