Eval Comparisons | LangSmith Evaluations - Part 7

LangChain
8 Apr 202408:51

Summary

TLDRこの動画スクリプトは、EV(評価)システムの重要性と興味深さを説明し、Lang Smith Primitives、手動データセットの作成、ユーザーログからのデータセット構築、データセット評価方法、組み込みLang Chain Evaluatorの使用、カスタム評価器の構築など、一連のトピックについて説明しています。実際の使用事例に焦点を当て、ローカル環境でのMistra 7とGP35 Turboの比較を通じて、品質とパフォーマンスの比較を行いました。ABテストの有用性と、Lang Chainの柔軟性についても触れています。

Takeaways

  • 📚 シリーズの第7回目の動画で、EV valsの重要性と興味深さを紹介しています。
  • 🔍 以前の動画では、Lang Smith Primitivesや手動で作成したデータセットについて説明していました。
  • 💻 今回は、実際のユースケースとニーズに焦点を当て、「mistra 7」がローカル環境で動作する様子を比較します。
  • 📈 データセットの評価方法として、組み込みのLang chain evaluatorを使用する方法を紹介しています。
  • 🔧 カスタム評価器を構築する方法についても説明し、実際のデータセットを使ってABテストを行いました。
  • 🖥️ 動画では、ローカル環境で動作する「mistra 7」とOpenAIのパフォーマンスを比較しています。
  • 📊 ABテストの結果、OpenAIの方がスコアや遅延の面で優れていることが示されていますが、「mistra 7」の品質についても詳細に分析しています。
  • 🔎 動画では、個々の回答の詳細を比較し、どちらが正解であるかを確認するプロセスを説明しています。
  • 🛠️ データセットの作成方法についても再確認し、ユーザーログからのデータセット作成や手動キュレーションなど様々な方法を紹介しています。
  • 📝 評価器やABテストの使用方法が詳細に説明されており、様々なパラメーターを比較するための柔軟性があることが示されています。
  • 🚀 このシリーズの最終動画では、導入概念を概説し、今後の動画でより深いテーマに掘り下げることを示唆しています。

Q & A

  • EV valsの重要性について説明してください。

    -EV valsは、言語モデルの性能を評価するために非常に重要です。適切な評価方法を用いることで、モデルが実際の使用場面でどのように機能するかを正確に評価することができます。

  • Lang Smith Primitivesとは何ですか?

    -Lang Smith Primitivesは、言語モデルの開発と評価において使用される基本的なツールや機能のことを指します。これには、データセットの作成や問題の設定、評価方法の選択などが含まれます。

  • 手動でキュレートされたデータセットを作成する方法を説明してください。

    -手動でキュレートされたデータセットを作成するには、専門家の知識や経験を利用して、特定のタスクに関連するデータを選択し、適切なフォーマットに整理する必要があります。このプロセスには、データの収集、分類、注釈付けなどが含まれます。

  • ユーザーログからデータセットを作成する方法について説明してください。

    -ユーザーログからデータセットを作成するには、実際のアプリケーションの使用状況を記録し、ユーザーの質問や要望を抽出します。これらの情報をもとに、問題と解答のペアを作成し、モデルの訓練や評価に使用できるデータセットを構築します。

  • データセットの評価方法として 언급されたバリュエーターとは何ですか?

    -バリュエーターは、データセットの質を評価するために使用されるツールです。異なる種類のバリュエーターを用いて、問題の正解率やモデルの応答の品質などを定量的に評価することができます。

  • Lang chain evaluatorの機能について説明してください。

    -Lang chain evaluatorは、言語モデルの応答を自動的に評価するためのツールです。この評価器は、問題とその正解のペアを用いて、モデルの応答がどの程度正確かどうかを判断します。

  • ABテストとは何ですか?

    -ABテストは、製品やサービスの異なるバージョンを比較するための一種の試験方法です。ここでは、異なる言語モデルやプロンプトなどを比較し、どちらがより優れた結果を出すかを評価します。

  • ローカル環境でMira 7Bを実行することについて説明してください。

    -Mira 7Bをローカル環境で実行するには、適切なハードウェアとソフトウェアの設定が必要です。この場合、M2 Macと32GBのRAMを使用して、OpenAIのAPIを用いてモデルを実行しています。

  • Mira 7BとGP35 Turboの比較結果について説明してください。

    -Mira 7BとGP35 Turboの比較では、OpenAIのAPIを使用したGP35 Turboの方がスコアや遅延の点で優れていますが、Mira 7Bもローカル環境で十分な品質の応答を生成しています。

  • ABテストの利点は何ですか?

    -ABテストの利点は、異なるモデルやプロンプトの効果を直接比較できることです。これにより、最適な設定や改善の方向性を明確にし、製品やサービスの品質向上に繋がります。

  • このビデオスクリプトの目的は何ですか?

    -このビデオスクリプトの目的は、言語モデルの評価方法やABテストの重要性について説明し、実際の使用例を通じてこれらの概念を理解しやすくすることです。

Outlines

00:00

🤖 Lang ChainとSmithの評価シリーズ第7弾

この段落では、Lang ChainとSmithの評価シリーズの第7回目の動画が紹介されています。シリーズの初回はEV valsの重要性について説明し、2番目の動画ではLang Smith Primitivesについて話しました。3番目の動画では、データセットの作成方法を、4番目はユーザーログからデータセットを作成する方法を紹介しました。5番目では、データセットのバリデータとしてbuilt-in Lang chain evaluatorを使用する方法について説明し、6番目ではカスタムバリデータについて議論しました。今回、実際のユースケースに焦点を当て、misdra 7とgp35 turboのパフォーマンスを比較することに焦点を当てています。

05:02

🔍 ABテストによるLang Chainの比較分析

この段落では、ABテストを使用してLang Chainの比較分析を行う方法が説明されています。具体的な手順として、データセットの作成、ビルトインのCoot QA評価器の使用、ABテストの実施、そして結果の比較が行われています。特に、misdra 7とgp35 turboの比較において、misdra 7がローカル環境で動作する様子や、両者のパフォーマンスを比較することが重要です。また、結果の分析においては、正解率や遅延などの統計的指標が重要となります。

Mindmap

Keywords

💡EV vals

EV vals とは、動画スクリプトで言及されているエビデンスに基づくバリデーションの略です。これは、ある仮説やモデルの信頼性や正確さを評価するために使用されます。この動画では、EV vals が重要である理由やどのように使用されるかについて説明しています。

💡Lang Smith Primitives

Lang Smith Primitives は、動画スクリプトで言及されている言語モデルの基礎的な要素や機能を指します。これには、テキスト解析や応答生成など、言語モデルが持つ基本的な機能が含まれます。

💡データセットの作成

データセットの作成は、人工知能や機械学習の分野で非常に重要なプロセスです。この動画では、手動でデータセットを作成する方法について説明されており、データセットは、アプリの生産環境でのユーザーの質問をキャプチャして作成することができます。

💡ユーザーログ

ユーザーログは、アプリの使用状況やユーザーの行動を記録するデータです。この動画では、ユーザーログからデータセットを作成する方法について説明されており、これにより、アプリの実際の使用状況に基づいて言語モデルを改善することができます。

💡データセットの評価

データセットの評価は、データセットの品質や性能を測定することを指します。この動画では、データセットを評価するための様々な方法が説明されており、これにより、言語モデルの正確さや信頼性を定量的に評価することができます。

💡カスタム評価器

カスタム評価器は、特定のニーズや要件に合わせてカスタマイズされた評価システムです。この動画では、カスタム評価器を作成し、それをデータセットの評価に使用する方法について説明されています。

💡比較試験

比較試験は、2つまたは複数の項目を対比して、どちらが優れているかを判断することを指します。この動画では、比較試験を使用して、異なる言語モデルの性能を評価する方法について説明されています。

💡misra 7

misra 7は、動画スクリプトで言及されている言語モデルの1つです。このモデルは、ローカルコンピューター上で実行され、open AIと比較して遅いながらも品質を維持していることが示されています。

💡gp35 turbo

gp35 turboは、動画スクリプトで言及されている別の言語モデルです。このモデルは、高速で応答することができ、misra 7と比較して性能比較の対象となっています。

💡ABテスト

ABテストは、2つのバージョンの製品やサービスを比較し、どちらがより優れているかを判断するための試験方法です。この動画では、ABテストを使用して、異なる言語モデルの性能を比較する方法について説明されています。

💡品質

品質とは、製品やサービスが期待される基準や水準に達していることを指します。この動画では、言語モデルの応答の品質を比較するために、品質の評価が重要視されています。

Highlights

Introduction to the importance and interest of EV valves in the context of Langs Smith evaluation series.

Discussion on Lang Smith Primitives and their role in the evaluation process.

Demonstration of creating manually curated datasets based on a datab ras blog post.

Explanation of building datasets from user logs for apps in production.

Overview of various judges for datasets and the use of a built-in Lang chain evaluator for question answering.

Presentation of a flow diagram and guidance on where to find more detailed information on the topics.

Real-world use cases and the need for comparisons, specifically asking how Mistra 7 performs locally on a laptop compared to gp35 turbo.

Note on using Alama for the comparison, with instructions on obtaining the model.

Description of the setup for comparing Mistra running locally on a laptop with open AI.

Emphasis on the importance of quality comparison over speed in the local vs cloud model challenge.

Explanation of the developer-curated dataset of four examples on the data bricks block post used as a basis for the evaluation.

Use of LM as a judge and the built-in coot QA evaluator for the AB test between gbd 35 turbo and mraw.

Description of the process and ease of conducting an AB test with the new function and the Lang chain platform.

Showcase of the comparison mode and its ability to provide immediate statistics on the two runs.

Detail on the inspection of individual answers and the grading process, highlighting the differences between the outputs of mraw and open AI.

Discussion on the incorrect grading of mraw's response and the investigation into the context window issue.

Illustration of the power of comparative AB testing for different prompts and LLMs, and the simplicity of conducting such tests with the Lang chain platform.

Summary of the introductory concepts covered in the video series and a teaser for deeper themes to be explored in future videos.

Transcripts

play00:00

hi this is L Lang chain this is the

play00:02

seventh video in our Langs Smith

play00:03

evaluation series um so our first video

play00:07

gave kind of a context as to why EV vals

play00:08

are interesting and important the second

play00:11

video talk about Lang Smith Primitives

play00:13

our third video showed how to create

play00:15

manually curated data sets we built one

play00:17

based upon this datab bras blog post um

play00:20

the fourth one showed how to build data

play00:22

set from user logs so if You' have an

play00:24

app in production you want to kind of

play00:25

capture user questions and create a data

play00:28

set from them you can very easily do

play00:29

that we talked through that um we then

play00:32

talked about various judges for data

play00:34

sets so different types of valuators we

play00:36

should how to build use a built in Lang

play00:38

chain evaluator um for question

play00:41

answering we applied that to our data

play00:43

data set um and we just talked through

play00:48

custom evaluator so again we've kind of

play00:50

showed this this flow diagram and go to

play00:53

go to those videos if you want to kind

play00:54

of Deep dive into those

play00:56

topics now we're going to have a little

play00:58

bit of fun so this is where you know you

play01:01

kind of get into like very real world

play01:02

use cases and and

play01:05

needs you often want to do

play01:08

comparisons so let's ask a really

play01:10

practical

play01:11

question how does mistra 7 be running

play01:14

locally on my laptop compared to gp35

play01:16

turbo on this little challenge we've set

play01:18

up again remember we've four question

play01:20

eval set on this data bre blog post p

play01:24

and open L undo versus uh gbd 35 turbo

play01:28

so just a little note here I'm using

play01:29

Alama for this um just you can download

play01:32

it going to uh uh ama.com you can do

play01:36

Alama P mstr to get the model and you

play01:39

can kind of follow instructions here um

play01:42

so here's my setup I'm going to create a

play01:45

new function that does the same thing

play01:47

that we already were doing with open AI

play01:49

but here I'm going using MW this is

play01:51

running locally on my laptop so again it

play01:53

just I can answer ask and answer

play01:55

questions about the particular blog post

play01:58

so I answered I just asked a question

play02:00

and here we go so you know the answer is

play02:03

streaming out very good and it's

play02:04

obviously slower than open AI exactly

play02:06

what we would expect but we really care

play02:08

out here is I want to know about quality

play02:10

how does it actually compare on this

play02:11

little challenge I built for myself so

play02:13

what are we actually doing uh here we a

play02:17

developer curated data set of four

play02:19

examples on this data bricks block post

play02:22

um I'm using LM as a judge again

play02:24

remember the built-in coot QA evaluator

play02:26

I'm using um and I ground truth answers

play02:29

for every question I'm doing an AB test

play02:32

between gbd 35 turbo and mraw running

play02:36

locally on my laptop so that's the setup

play02:39

um and it's pretty easy so remember

play02:42

we've already built or defined this data

play02:44

set dbrx we've already used this to

play02:47

evaluator coqa so that doesn't change at

play02:49

all all that changes is I'm just passing

play02:52

in this new function now now let's go

play02:54

back and look at that function it looks

play02:55

exactly like our old one a few little

play02:57

twists I'm using ol instead of open AI

play02:59

that's really get same output object

play03:02

answer you addict with an answer that's

play03:05

it simple we just saw it work

play03:07

here so what I can do is kick off the SE

play03:11

valve this will take a little bit cuz

play03:12

it's running locally I have an M2 Mac uh

play03:15

with 32 gigs by the way so that kind of

play03:17

gives you some sense I've heard a lot of

play03:19

people having good results using Mr all

play03:20

7B on on Far smaller machines though so

play03:24

it's a really nice open model to work

play03:26

with if you want and you can see it's

play03:27

still churning it's streaming its

play03:29

answers out here it's actually done so

play03:30

it didn't take that long it ran against

play03:32

my four questions now here's where it

play03:34

can get really interesting let's go over

play03:37

to my data set now I can see here that

play03:41

there's three runs so this is our

play03:43

initial run uh experiment you can think

play03:46

of with open AI this is that second one

play03:48

to do with a custom evaluator we're not

play03:50

interested in that that was just kind of

play03:51

a quick more unit test that wasn't a

play03:53

proper kind of LM based evaluation and

play03:56

now here's our latest one so here's

play03:58

where the gets really

play04:00

interesting I can click on um this and

play04:06

this so my mraw run my open eye run and

play04:09

I can click this compare thing that

play04:11

opens up this compare mode and you

play04:13

already see some nice statistics here so

play04:16

what I can see is the average score so

play04:19

the first run which was up in AI indeed

play04:21

does quite a bit better in terms of

play04:23

score latency as exactly we would expect

play04:26

M draw slower by quite a bit um and

play04:29

here's a latency dis and so forth so you

play04:31

get some immediate statistics about the

play04:33

two

play04:34

runs now here's where I've done a lot of

play04:37

work in the past and you know this is

play04:40

kind of the Crux of AB testing that's

play04:43

extremely useful um that's why it's very

play04:45

helps to do this inside Lang is all kind

play04:47

have captured for you managing this all

play04:48

yourself is can be quite painful here's

play04:51

my first question here's a reference

play04:54

output here is the output returned by

play04:57

mraw here's the output returned by open

play04:59

AI so I can actually look at those in

play05:01

detail I can like kind of zoom in look

play05:03

at the answers and like hey they they

play05:05

look very similar here that's really

play05:07

cool and you can see my greater also

play05:10

assesses them both as correct and again

play05:12

we talked about you can actually click

play05:13

on the evaluator run for each case to

play05:14

see why but they look good now here's

play05:17

where it gets a little interesting it

play05:19

looks like my mistr running locally is

play05:21

is did not receive a correct

play05:24

grade um and I did so let's actually

play05:29

look at what was the question what is

play05:31

the context window of the drb ex Dro

play05:33

model okay so it's 32k token right what

play05:36

did mrra think uh cont is oo 2048 so

play05:41

that is definitely wrong and we would

play05:44

have to investigate as to why Mr

play05:46

believed that to be the case it could be

play05:48

you know there could be many different

play05:49

reasons why I failed for that one but

play05:51

indeed our grader is correctly grading

play05:53

that as as a as a wrong response for fun

play05:55

we can actually dig in and look at uh

play05:59

that particular grading trace and we can

play06:02

see why stud's answer is incorrect the

play06:04

student States at the context window is

play06:06

2048 um the Contex says clearly

play06:10

32k there you go so the grer is doing

play06:13

the same thing and we can kind of go

play06:15

through each one so this is like a toy

play06:18

example but it shows you a very

play06:20

important useful concept of comparative

play06:22

AB testing so like you might want to

play06:24

compare different prompts different llms

play06:26

and this is a very nice way to do that

play06:27

you can see it's extremely simple we've

play06:29

just supplied our data set name um so

play06:32

we're of course run against the same

play06:34

data set where you know typically I like

play06:36

to apply different experimental prefix

play06:39

to to enumerate the different

play06:41

experiments and running so that's easy

play06:42

you can also capture that in metadata by

play06:44

the way so that's another way to kind of

play06:46

differentiate your experiments um and

play06:49

I'm using the same grader of course and

play06:51

I'm just modifying the my function which

play06:53

in this case was just hey swapping out

play06:56

mistol uh swapp swapping in mistol for

play06:59

for opening I so again this just shows

play07:02

you how to use this compare mode and

play07:04

limith to do ab testing really nicely um

play07:07

in this particular case we're comparing

play07:08

mrra versus open AI we can look at you

play07:10

know kind of overall run statistics as

play07:12

well as granular answer wise differences

play07:15

we can inspect the greater as shown here

play07:17

we can look at the runs as shown here so

play07:19

this gives you a very flexible General

play07:21

place to do ab testing uh across

play07:24

different parameters in this casat I use

play07:26

different uh different llms um and I've

play07:28

used this all the time for lots of

play07:30

different kind of projects and it is

play07:33

indeed quite useful it's very nice to

play07:34

have this all kind of managed in one

play07:36

place for you um so we're going to be

play07:38

kind of diving into some uh deeper

play07:39

themes after this this is kind of the

play07:41

final video of our like kind of

play07:43

introductory Concepts so if we kind of

play07:44

Zoom all the way back out what did we

play07:46

talk through we just talked through man

play07:49

building your M Cur data set in this

play07:51

case running Elm as a judge against the

play07:53

ground Truth for AB testing so we kind

play07:55

of went through that we also had talks

play07:57

through um you know same setup but basic

play08:00

just simple unit test using custom

play08:02

evaluators we talked through

play08:05

um yep we talked through yeah different

play08:08

data set creation yeah we talked through

play08:10

here we go Len is a judge with ground

play08:12

truth um so for like you know uh just

play08:16

just you know Len is greater evaluation

play08:19

um but no AB test so in that case you're

play08:22

just looking at like a single a single

play08:23

model and evaluating it using LM as as a

play08:26

judge um we talked about the information

play08:28

flow for valuation

play08:30

we've talk about different ways to build

play08:31

data sets from user logs from manual

play08:34

curation and that's really it this gives

play08:36

you kind of like the groundwork you need

play08:38

to do a lot of different things building

play08:40

custom evaluators and AB testing is

play08:42

frankly covers a huge surface area of

play08:44

use cases uh and we're going to do some

play08:46

deep Dives following this so stay tuned

play08:48

for for additional videos

play08:50

thanks

Rate This

5.0 / 5 (0 votes)

Related Tags
LangSmithデータセットABテスト品質評価機械学習比較分析ローカルランブログ記事開発者向け評価ツール
Do you need a summary in English?