Regression Testing | LangSmith Evaluations - Part 15
Summary
TLDRこのビデオスクリプトでは、言語モデル(LLM)のパイプラインを構築し、評価するためのレグレッションテストについて説明されています。最近発表された新しいオープンソースLLM、例えばLLaMa 3や53などを使って、既存のLLM(例:GPT-4)と比較して、特定のユースケースに最適なLLMを選ぶ方法が紹介されています。レグレッションテストは、評価セットを構築し、異なるLLMで生成された結果を基準値と比較することで、改善点や悪化点を特定できるという利点を強調しています。また、評価セットの作成方法や、異なるLLMを指定して実行する方法、結果を比較し、基準値に比べて改善または悪化している箇所を特定する方法が詳しく説明されています。最適なLLMを選択し、言語モデルアプリケーションを構築する際に非常に役立つプロセスとツールが紹介されています。
Takeaways
- 📈 **レグレッションテストの重要性**: レグレッションテストは、新しい言語モデル(LLM)を導入した場合に、既存のベースラインと比較して、パフォーマンスが向上または下落しているかどうかを特定するのに役立ちます。
- 🔍 **評価セットの構築**: 評価セットを作成し、それを使用して異なるLLMをテストすることで、特定の使用ケースにおいてのパフォーマンスを評価できます。
- 🔧 **ラギングパイプラインの変更**: LLMを変更する場合、レグレッションテストを使用して、新しいLLMが既存のベースラインと比較してどのように機能するかを判断できます。
- 🆕 **オープンソースLLMの活用**: 最近出された新しいオープンソースLLM(例:LLaMa 3、53)を使用して、既存のベースライン(例:GPT-4)と比較することができます。
- 📚 **ドキュメントのインデックス作成**: ラギングパイプラインで使用されるドキュメントをインデックス化し、その大きさや構成を最適化することが重要です。
- 📝 **評価指標の設定**: 回答のグラウンドトゥルースに沿っているかどうかなど、回答の質を評価するための基準を設定することが可能です。
- 🟢⚠ **結果の可視化**: レグレッションテストの結果を視覚的に確認できることで、パフォーマンスが向上している箇所と下落している箇所を迅速に特定できます。
- 🔬 **詳細な分析**: 個々のケースをクリックして、詳細な分析やスコアリングの理由を確認することが可能です。
- 📊 **メトリックスの確認**: トークン使用状況やレイテンシなどのメトリックスを確認することで、パフォーマンスをさらに理解できます。
- 🔄 **改善と悪化の繰り返し**: レグレッションテストを繰り返し行い、改善と悪化を特定し、その理由を分析することで、より良いLLMアプリケーションを構築できます。
- 🛠️ **柔軟なパイプラインの拡張**: ラギングパイプラインは、異なるLLMを指定できる柔軟性を持っており、必要に応じて簡単に拡張できます。
- 🔗 **オープンソースとの連携**: オープンソースLLMをローカルで実行し、プロバイダーとしてOpenAIと比較することができます。
Q & A
ラングスミス評価シリーズの15番目のビデオで扱われている主題は何ですか?
-回帰テストに焦点を当てたラングスミス評価シリーズの15番目のビデオでは、リグレッションテストについて説明されています。
リグレッションテストとは何ですか?
-リグレッションテストは、特定の基準やベースラインに対して、システムのパフォーマンスが改善されたり劣化したりしているかどうかを評価するプロセスです。
ビデオでは、どのような新しいオープンソースLLMが紹介されましたか?
-ビデオでは、最近発表された新しいオープンソースLLMとして、LLaMA 3とLLaMA 53が紹介されました。
ベースラインモデルとして使用されていたものは何ですか?
-ビデオでは、GPT-4がベースラインモデルとして使用されていたと説明されています。
評価セットの作成に使用される言語は何ですか?
-評価セットの作成に使用される言語は、Line Change Expression Languageです。
ビデオで説明されているRAGパイプラインとは何ですか?
-RAGパイプラインとは、Retrieve And Generate(検索と生成)という意味で、情報検索と生成タスクを組み合わせたプロセスです。
評価の際に使用される主要な指標は何ですか?
-評価の際に使用される主要な指標は、回答が真実に基づいており、基準点からどれだけ離れているかを示すスコアです。
ビデオで説明されているエバリュエーターの役割は何ですか?
-エバリュエーターは、回答の質を評価し、基準点に対してスコアを割り当てることで、回答がどれだけ優れたものかを判断する役割を果たします。
ビデオの最後で述べられている、リグレッションテストの強力な点は何ですか?
-リグレッションテストの強力な点は、異なるモデルや異なるチャンクサイズなどの異なるバリエーションで、チェーンが改善されたり劣化したりしているケースを特定できることです。
ビデオで説明されているAMAとは何ですか?
-AMAとは、複数のオープンソースLLMをローカルで実行できるようにするツールであり、ビデオではLLaMA 3やLLaMA 53をローカルで実行するために使用されています。
評価結果を分析する際に使用される色分けは何を意味していますか?
-評価結果を分析する際に使用される色分けでは、赤色はベースラインよりもパフォーマンスが劣っていることを示し、緑色は改善されていることを示します。
ビデオで説明されているRAG QA LCLとは何ですか?
-RAG QA LCLとは、評価セットの名前であり、ビデオで使用される特定の問い合わせと回答のセットを指します。
Outlines
😀 ランダムアクセスメモリ(RAM)の評価と回帰テストの紹介
この動画スクリプトは、ランダムアクセスメモリ(RAM)の評価シリーズの15番目のビデオであり、回帰テストに焦点を当てています。以前のビデオでは、RAMチェーンの評価方法について語り合いました。例えば、参照文書やドキュメントに対しての回答の質、または問いに対する検索の関連性などです。ここでは、RAMパイプラインを構築する際によくある問題が1つ挙げられます。つまり、新しいオープンソースのLLMが登場した場合、それを自分のベースラインとして使用することができます。回帰テストは、さまざまな例で評価セットを実行し、基準と比較して改善または悪化しているケースを特定する能力を提供します。また、評価セットの構築方法や、インデックスの作成方法、そしてRAMパイプラインのレイアウト方法についても説明しています。
📊 LLMの性能比較と回帰テストの活用
この段落では、評価セットを使ってLLMの性能を比較し、基準と比較して改善または悪化しているケースを特定する方法が説明されています。赤いセルは基準より悪いパフォーマンスを意味し、緑のセルは良いパフォーマンスを意味します。また、評価ランをクリックすることで、特定のスコアがなぜ与えられたのかを監査することができます。さらに、表示設定でトークン使用状況やレイテンシーなどの追加メトリックを確認することができ、生成物の全文も表示可能です。回帰テストは、異なるモデルやチャンクサイズなどの変更によって、RAMチェーンがどのように変わるかに注目する強力な方法です。
Mindmap
Keywords
💡ラングスミス評価
💡回帰テスト
💡LLM (Large Language Model)
💡評価セット
💡インデックス
💡RAG パイプライン
💡評価基準
💡ベースライン
💡改善点
💡悪化点
💡トレース
Highlights
The video focuses on regression testing in the context of LangSmith evaluation series.
Discusses the evaluation of the rag chain answer against a reference or the documents for hallucinations and retrieval relevance.
Explains the scenario of wanting to change the LLM in a rag pipeline and how to determine the suitability of new models like LLaMa 3 or 53.
Introduces the concept of regression testing to identify improvements or regressions relative to a baseline model.
Demonstrates building a new evaluation set called RAG QA LCL using the same line change expression language documentation.
Mentions indexing a large chunk of the documentation with no major changes from previous rag videos.
Details a slight modification in the rag pipeline to specify different providers, allowing for the use of various open-source LLMs.
Shows how to run the rag chain with different LLMs, including Open AI, LLaMa 3, and LLaMa 53, using the AMA tool.
Presents an evaluator for answers that assesses if the assistant's answer is grounded in the ground truth answer with a scoring system.
Runs evaluations on Open AI, LLaMa 3, and LLaMa 53 and discusses analyzing the dataset RAB QA LCL.
Illustrates the use of a comparison mode to view the three experiments and identify performance relative to the baseline.
Highlights the visual indicators (red or green cells) that represent performance worse or better than the baseline.
Shows how to audit the evaluator run to understand why a particular score was given.
Discusses the convenience of preserving the baseline and its importance in the evaluation process.
Introduces the feature to highlight only cases that improve or regress relative to the baseline.
Mentions the ability to view additional metrics like token usage and latencies for a deeper analysis.
Explains how to view the full text of generations and audit the entire chain for a specific case.
Emphasizes the usefulness of regression testing in identifying cases where the chain is getting worse or better with different models or perturbations.
Encourages the audience to use regression testing as it is extremely useful and helpful in building LLM applications.
Transcripts
this is last L chain this is the 15th
video in our Langs Smith evaluation
series we're going to focusing on
regression testing so the past few
videos talked a lot about rag evaluation
just to refresh for example we talked
about how to evaluate the rag chain
answer versus a reference or the answer
versus the documents for hallucinations
or even the documents relative to the
question for kind of retrieval relevance
now here's a common situation that comes
up when I think about building a rag
pipeline what if I want to change the
llm so you know good example is some
pretty cool and interesting new open
source LMS have recently come out like
llama 3 53 how can I know whether or not
I can replace for example gbd4 as my
Baseline with one of these for my
particular use case and my particular
rag
pipeline this is where there a notion of
aggression testing comes in so we
previously had talked about building an
eal set running it on you know for
example are answers and evaluating
answer relevance or or answer you know
accuracy in this case relative to uh
ground truth answer um regression
testing allows me to run this on a few
different examples like let's say
different llms that perform the
generation step and to identify cases
that either improve or regress relative
to my Baseline so the key point of
regression testing is the ability to
isolate instances in your eval set they
even getting better or worse so that's
kind of the main intuition
so to kick this off I'm just going to
build a new eval set so that's all
defined here it's going to be called rag
QA LCL so it's going to use the same uh
line change expression language
documentation I used for the prior rag
videos just a few other you get a few
slightly different questions so I've
built that and I've built my index um so
again we're just indexing the line CH
expression language documentation again
I'm choosing a large chunk size just
like we saw before no major
changes um so I've laid out my rag
pipeline and this looks very similar we
saw before the only difference is I've
added a slight modification where I can
specify different providers so in this
case I can choose AMA uh which allows me
to run a number of Open Source llms
locally along with open Ai and again
just like rag prompts for the open
source models versus open AI um but you
know again not no major differences here
really I'm just extending my rag model
or my rag chain so I can run with
different llms that's all I'm doing here
and I'm defining three of them so I have
my ra chain with open AI rag chain with
llama 3 and rag chain with 53 again
llama 3 and 53 we use open AI as a
provider and I'm just specifying the
model I've already downloaded these
locally just with simply AMA pull llama
3 orama pull 53 and it'll just run
locally on my laptop so that's a whole
separate thing but that's a pretty cool
nice thing about
AMA um so I've defined an evaluator for
answers so we saw this previously this
labeled score string evaluator basically
lets me Supply some criteria so in this
case you know I'm asking is the
assistant answer grounded in the ground
truth answer and I give it you know some
criteria for scoring one through 10 10
being the best one being the worst so
that's all all that's going on here and
I kick off my eval right so I run eval
on open AI first I run eval on llama 3 I
run eval on th3 so those evals have run
now let's go over and look at my data
set so here is the data set we created
again RAB QA LCL let's just confirm that
here yeah so this is the this is evil
set we're running on and it's the evil
set we created up here so that's right
here so we created our eval set now we
can look at our experiments so this is
what we saw before right so this is our
experiment page no major changes here
right we can see our three experiments
run here now what I'm going to do is I'm
going to select these three experiments
so I'm going to go one two three and I'm
going to open this comparison mod this
is where things are going to get kind of
interesting we're going to see some
things that are a bit new here and let
me just scroll over a little bit so
first we're going to see is the three
experiments we selected are all here
okay and we're seeing this idea of a
baseline so what does Baseline mean the
Baseline is basically our reference so
in my particular case so let's just say
gbd4 was my prior Baseline right so gbd4
was the model that I had been using and
I want to see how th3 and llama 3
compare to GPD 4 so what I can do really
easily is so these are our three
examples just like we saw so again I can
click on this and this will basically
open up the example so I can see here's
the question here's the answer so that's
just like you know uh we we've kind of
gone through that
before um so here's the input here's
reference output and now here's my three
experiments and you can see just like
before we've set a
baseline um and I can see the scores
from my evaluator here now what's
interesting is I can scroll over and I
can look at my two other experiments so
llama 3 here 53 here so what's pretty
cool is immediately your attention is
drawn to these red or green cells and
this simply means if it's a red cell it
means the performance is worse than my
Baseline if it's a green I me it's
better so in this case right my Baseline
was 0.1 in this case 53 actually for the
second example does better it got a
score of 0.5 so that's why it's green um
otherwise you can see there's
regressions across the board um for uh
questions one and three for both of the
models now I can do a few different
things here first like we saw before I
can always click on this button and that
that actually opens up the evaluator run
itself so I can audit the evaluator so
that's again we we talked about that
previously it's really useful you can
kind of see why particular score was
given so that's really
cool uh and I can go back and you can
see my Baseline is still preserved so
that's actually very convenient um now
this thing at the top tells me the
number of total regressions or
progressions or improvements relative to
my Baseline so I can click this and
it'll highlight only the cases that
improve click this it'll highlight only
the cases that regress again likewise
here um so again it's really useful and
nice way to drill into the cases that
are improving or getting worse relative
to a baseline in this case there's only
three examples but in realistic cases
you may have an eal set of maybe dozens
or hundreds of examples so this can very
easily be used to isolate your
progressions or your improvements and
your regressions so you know it's it's
it's really helpful I do want to also
show here if you go to the display you
can actually open up um you know
additional metrics this can show you
like this will show you token usage this
will show you uh latencies so you can
kind of close that down to make lesser
of those uh you can see the full text of
the generations if you want to see that
but again it's it's by default of
removed so it's like way cleaner um
and that's probably the main things I'd
like to show you there you can of course
choose different experiments or
additional experiments if they're not
all Chen here it's easy to add
experiments so anyway this is a really
useful and convenient thing I I do this
all the time so I'm always running
experiments with different llms I always
want to isolate cases that are improving
or regressing and I want to dig into why
and basically using these filters I can
very easily isolate the cases that are
for example getting worse drill into y
again in each of these cases you can see
you actually can look at the trace again
so you this will drill into the trace
that resulted in the generation I can go
down I can audit the entire chain so
this is like my cadow Lama uh invocation
here this is like the prompt which
contains yeah the context my rag answer
so again a lot of things you can play
with here really useful uh and
regression testing is obviously super
powerful uh for identifying cases that
your chain for example is getting worse
or better with different pertubations
like different models uh different
chunks or other things so definitely
play with us it's extremely useful and
and helpful in building llm applications
thanks
تصفح المزيد من مقاطع الفيديو ذات الصلة
Evaluations in the prompt playground | LangSmith Evaluations - Part 8
Single Step | LangSmith Evaluation - Part 25
Determinism in the AI Tech Stack (LLMs): Temperature, Seeds, and Tools
Summary Evaluators | LangSmith Evaluations - Part 11
RAG Evaluation (Document Relevance) | LangSmith Evaluations - Part 14
RAG From Scratch: Part 1 (Overview)
5.0 / 5 (0 votes)