Datasets From Traces | LangSmith Evaluations - Part 4

LangChain
8 Apr 202405:29

Summary

TLDRこの動画スクリプトは、Langs Smith評価に関するシリーズの第4回。前回までの動画で評価の重要性や基礎概念を学んだ後、今回はユーザーログからデータセットを作成する方法について説明。簡単なアプリの例を通じて、ユーザーの質問とアプリの回答を記録し、それらをデータセットとして保存する方法を紹介。このデータセットは、評価や微調整のために後で使用できる。

Takeaways

  • 📌 評価的重要性と興味深さについて説明された(视频一)
  • 🛠️ Langs Smithの基礎となるPrimitivesについての解説(视频二)
  • 📈 データセットの作成方法についての具体例の説明
  • 🔍 ブログ記事から手動でQ&Aデータセットを作成する例の紹介
  • 🛠️ SDKを使ったデータセットの構築と更新の方法
  • 🖥️ UIを使ったデータセットの作成方法
  • 🤔 生産環境でのアプリケーションのトレースログからデータセットを作成する方法の探求
  • 🎯 ユーザーのインプットを趣味深く活用してデータセットを作成する例
  • 🔗 シンプルなAPIを使用したアプリケーションの例と、それに関連するユーザーの質問
  • 🗂️ Lang Smithでのトレースの確認とデータセット化の方法
  • 🔄 チャットデータセットの作成と、将来のファインチューニングのための入力形式の説明
  • ✂️ データセットのエディット方法と、AIが提供した回答をGROUND TRUTHに変更する手法
  • 🔍 ユーザーのインタラクションをログに記録し、それを高品質の評価セットに転換する手法の説明

Q & A

  • 動画の第1部で説明されたevalsの興味深い点は何ですか?

    -動画の第1部では、evalsが重要である理由について説明されています。

  • Langs Smith Primitivesとは何ですか?

    -Langs Smith Primitivesは、Langs Smithの評価を理解するための基礎的な要素です。

  • データセットの作成についてどのような例が説明されていますか?

    -例として、最近のデータブレークLMに関するブログ記事から質問と回答のペアのデータセットを作成する方法が説明されています。

  • SDKを使用してデータセットをどのように構築および更新するのですか?

    -SDKを使用することで、データセットを構築し、更新することができます。

  • 本番環境で動作中のアプリからデータセットを作成する方法は何ですか?

    -本番環境で動作中のアプリからデータセットを作成するには、ユーザーのログを利用する方法が提案されています。

  • 新しいプロジェクトの名前は何ですか?

    -新しいプロジェクトの名前は「dbrx」です。

  • シンプルなアプリの機能は何ですか?

    -シンプルなアプリは、オープンAPIを使用して、ユーザーの質問に対して答えを提供するものです。

  • ユーザーの質問とアプリからの回答の例は何ですか?

    -ユーザーの質問の例は「トレーニング効率の主な違いは何ですか?」という質問です。アプリからの回答の例は「ここでは主な違いについて説明します」といった回答です。

  • ユーザーのインタラクションを記録するためにどうすればいいですか?

    -ユーザーのインタラクションを記録するために、Lang Smithのデータセット機能を使用して、ユーザーの質問とアプリからの回答を保存することができます。

  • データセットの作成後に何ができますか?

    -データセットの作成後に、データを編集、改善することができます。また、データセットをファインチューニングや評価のために使用することができます。

  • この動画スクリプトの主要なポイントは何ですか?

    -この動画スクリプトの主要なポイントは、ユーザーログからデータセットを構築する方法と、質問回答ペアを手動でキュレートする方法を紹介しています。

Outlines

00:00

📈 データセットの作成と評価

この段落では、LanceがLangs Smith評価の重要性と興味深い点について説明し、データセット作成の方法についても議論しています。動画の前半では、Langs Smithの基本的な要素とデータセットの作成方法について学び、後半では、実際のユーザーログに基づいてデータセットを作成する方法について説明しています。Lanceは、ブログ記事をもとにした質問と回答のペアからデータセットを作成し、それを用いて評価を行うデモンストレーションを行いました。また、実際のアプリケーションからのユーザーログを利用して、データセットを作成し、将来の評価に活用する方法についても説明しています。

05:01

🔍 ログからのデータセット構築と評価

この段落では、Lanceはログからのデータセット構築方法について詳しく説明しています。具体的な例として、ユーザーがアプリケーションとインタラクションする様子を捉えたログから、データセットを作成する方法について説明しています。Lanceは、簡単な質問に対する回答を自動的に生成するアプリケーションを例に取り、そのアプリケーションからのユーザーログをもとにデータセットを作成し、評価を行う方法を説明しています。また、データセット作成後に、不正解を正しい答えに修正して、高品質な評価セットを作成する手法についても触れています。この方法は、今後の動画でさらに掘り下げられる予定であり、データセットの構築と評価における重要なステップを示しています。

Mindmap

Keywords

💡Langs Smith evaluations

「Langs Smith evaluations」とは、動画のテーマであり、言語処理システムの評価方法に関するものです。この評価システムは、データセットの作成や改善、そして応用に基づいて機能します。動画では、Langs Smithの基本的な概念と評価方法について説明し、データセットの作成方法を具体的に示しています。

💡Data set creation

「データセットの作成」は、Langs Smith評価システムにおいて、新しい評価基準を構築するために必要なプロセスです。このプロセスには、問題と回答のペア、またはユーザーのログからデータセットを作成することが含まれます。データセットの作成は、言語処理システムの改善や最適化に不可欠なステップです。

💡SDK

「SDK」は、ソフトウェア開発キットの略で、特定のソフトウェアパッケージを開発するためのツールやライブラリのセットを指します。動画では、Langs SmithのSDKを使用してデータセットを構築し、更新する方法について説明されています。

💡User logs

「ユーザーログ」は、ユーザーがアプリケーションやシステムを使用した際に生成される情報を指します。これらのログは、システムの改善や問題の特定に役立つ貴重なデータ源です。動画では、ユーザーログからデータセットを作成し、評価システムを向上させる方法について学びます。

💡Question-answer pairs

「問題-回答ペア」とは、特定の問題に対する回答の組です。これは、データセットを作成する際に基本的な要素であり、言語処理システムの評価において重要な役割を果たします。動画では、問題-回答ペアの例を用いて、データセットの作成方法を説明しています。

💡Chat data set

「チャットデータセット」は、ユーザーの対話を記録したデータセットです。このデータセットは、チャットフォーマットの入力と出力を使用して作成され、言語処理システムの改善や最適化に役立ちます。動画では、チャットデータセットの作成方法と、その使用方法について説明されています。

💡Fine tuning

「ファインチューニング」は、既存の機械学習モデルを改善し、特定のタスクやデータセットに適合させるために行われるプロセスです。このプロセスは、データセットの品質やシステムの性能を向上させるために重要な役割を果たします。動画では、ファインチューニングの適用例として、チャットデータセットを使用する方法が説明されています。

💡Ground truth

「グラウンドトゥルス」とは、システムが生成した結果を正解と比較するための正解データの基準を指します。この概念は、システムの性能を評価し、改善するための重要な要素です。動画では、ユーザーログから生成されたデータセットをグラウンドトゥルスとして編集する方法について説明されています。

💡Mock user

「モックユーザー」とは、実際のユーザーとは異なり、テストやデモンストレーションのためにシステムに入力を提供する仮想ユーザーです。モックユーザーは、システムのテストや評価において、実際のユーザー行動を模倣して、システムの性能を評価する際に使用されます。

💡Evaluation sets

「評価セット」とは、システムの性能を評価するために使用されるデータセットです。これらのセットには、問題-回答ペアやユーザーのログが含まれ、システムが生成した結果を正解と比較するための基準となります。動画では、評価セットの作成方法と、その使用方法について説明されています。

Highlights

视频系列介绍了Langs Smith评估的重要性和方法。

第一个视频解释了评估的趣味性和重要性。

第二个视频讨论了Langs Smith Primitives,即Langs Smith评估的核心基础知识。

第三个视频涉及了数据集创建,特别是如何从博客文章中构建问答对数据集。

本视频(第四个)探讨了如何从生产环境中的应用日志中构建数据集。

展示了如何使用SDK和用户界面(UI)来构建和更新数据集。

介绍了一个名为dbrx的新项目,用于演示数据集的创建。

演示了如何从用户与简单问答应用的交互中提取有趣的输入。

讨论了如何将用户交互转换为可用于未来评估的数据集。

展示了如何将用户交互日志转换为聊天数据集格式。

强调了这种数据集类型对于未来如微调等高级用例的实用性。

说明了如何创建和保存数据集,以便后续工作和评估。

提供了编辑数据集的示例,以构建高质量的评估集。

讨论了通过记录和清理AI提供的答案来构建高质量评估集的常见技巧。

总结了如何从用户日志和手动策划的问答对中构建数据集的两种不同方法。

Transcripts

play00:00

hi this is Lance langing this is the

play00:02

fourth video on Langs Smith evaluations

play00:04

so in video one we kind of laid out why

play00:06

evals are interesting and important

play00:08

video two we talked about the Langs

play00:10

Smith Primitives like the core

play00:11

foundational pieces to understand about

play00:12

Langs Smith

play00:14

evaluation and we just talked about data

play00:16

set creation um we talked about an

play00:18

example of building a question answer

play00:21

pair data set from this blog post on

play00:22

that recent data breaks LM um so again

play00:25

we showed how to build like a manually

play00:27

curated uh data set here's our qu here's

play00:30

our inputs and our outputs um we use the

play00:34

SDK to build the data set and to update

play00:36

it we also showed how to use UI now a

play00:39

question I'd ask is okay that's great

play00:43

but what if I have an app in production

play00:45

I have traces being you know logged over

play00:48

to um to lsmith how to build a data set

play00:51

based on for example user logs so for

play00:53

example let's say there's a bunch of

play00:54

generations or user inputs I thought

play00:56

were interesting I want to build a data

play00:57

set from those so I can do future

play00:59

evaluations again it so let's do a kind

play01:02

of a toy example here let's create a new

play01:03

project we'll call this

play01:06

dbrx um and what I'm going to do is I'm

play01:08

going to load that blog post here we go

play01:11

so the same blog post we've been working

play01:13

with on the on the recent data breaks

play01:14

model now I'm going to Define here's my

play01:16

little toy app so it's just answer a

play01:19

question I'm using just open API not

play01:22

using Lang chain at all here really

play01:24

simple answer the user question based on

play01:26

two or three sentences given the context

play01:28

that's really it there we go

play01:30

so let's say this is like an app I have

play01:33

this in production somewhere users are

play01:34

just interacting with it um and I get a

play01:37

question here what are the main

play01:38

differences in training efficiency and

play01:40

you know they app answers here's another

play01:43

one cool so let's actually go over and

play01:47

we created uh a a project for

play01:51

this this

play01:53

over so I'm go to my projects so you can

play01:56

see those two generations that I just

play01:59

ran here are going to be logged to this

play02:02

project dbrx so now we're in this

play02:05

project and we see those two generations

play02:06

you can look at the time it matches

play02:07

roughly the time that is right now

play02:09

Pacific that's great so you know okay

play02:12

this is what we just saw this is

play02:14

actually kind of interesting to look at

play02:16

so here you can see this is the trace

play02:18

effectively so in this case the trace

play02:20

only has a single run so again we talked

play02:23

about there's runs and runs roll up into

play02:25

traces Trace contains all the different

play02:28

runs in a given like application this

play02:30

case it's a simple prompt response so

play02:32

there's only a single run and indeed the

play02:35

trace only has that single run in it so

play02:38

again you can kind of look over here

play02:39

here's your system prompt it plums in

play02:40

that whole blog post and you know the

play02:43

human prompt where what here is the

play02:45

question and then the output so very

play02:47

simple now let's say these are examples

play02:50

of user interactions with your app you

play02:51

want to capture them for posterity or

play02:53

for revaluation or whatever just click

play02:55

on the two so we're in Lang Smith now um

play02:58

and you see this thing down here adding

play03:00

data set so I click on that um I'm going

play03:03

to move this over so I'm going to call

play03:05

this a new data set let's just call it

play03:07

like

play03:09

dbrx uh QA

play03:13

testing

play03:15

testing here we go now it's

play03:18

automatically flaggs a chat data set

play03:20

recall previously we built a key value

play03:22

data set based with basically question

play03:25

answer uh key value pairs for the inputs

play03:27

and outputs in this case this is derived

play03:29

from chat session so it's a bit a

play03:30

different data set type and this is

play03:32

useful for example if you want something

play03:34

like fine tuning in the future the

play03:36

inputs are already in chat and

play03:37

serialized chat message format which is

play03:39

useful for for that which that's a more

play03:41

advanced use case we'll talk about

play03:43

later so you know that's really it we

play03:46

can just hit create and I'm going to go

play03:49

down to my data sets and let's just

play03:51

search

play03:52

dbrx boom and here it is you can see

play03:56

it's a chat data set it's derived from

play03:58

those inputs that my mock user provided

play04:02

um and you get the output so it's kind

play04:04

of basis set of input prompt output

play04:06

pairs from my app which I've now saved

play04:09

the data set which I could do work on uh

play04:12

accordingly and again just like before

play04:14

you can see you can edit these so for

play04:16

example if here's a really good use case

play04:19

you have a bunch of user um you know

play04:21

interactions or inputs to your system

play04:23

but your system produced the wrong

play04:25

answers if you want to turn this into

play04:27

like an EV eval set you could actually

play04:30

edit these to be ground truth answer but

play04:34

you still have the real user inputs in

play04:37

there so it's just a very kind of common

play04:39

trick for building high quality

play04:41

valuation sets um is to do this kind of

play04:44

logging and then potentially to clean

play04:47

the answers provided by the AI so set

play04:49

they then ground truth so that's really

play04:51

it so again if I zoom all the way back

play04:53

out what did we do we just showed how to

play04:55

build data sets from user logs from this

play04:57

little toy app that I built that's

play04:59

asking answering questions about a blog

play05:01

post so we're going to be kind of

play05:02

building on this in in some future

play05:03

videos but what we've really covered

play05:05

here is ability to build data sets from

play05:07

logs and uh manually curate them from

play05:11

like question answer pairs or it could

play05:13

really doesn't have to be question

play05:14

answer pairs but in that in this case I

play05:16

did um but you know developer curated

play05:20

versus in this particular case you know

play05:23

logge from a hypothetical user so two

play05:25

different ways of building data sets

play05:27

thanks

Rate This

5.0 / 5 (0 votes)

Related Tags
データセットユーザーログQ&Aペア評価方法機械学習人工知能データ収集ログ分析AI改善技術入門
Do you need a summary in English?