Evaluation Primitives | LangSmith Evaluations - Part 2
Key Takeaways
The video discusses the core primitives of LangSmith evaluations, including runs, traces, projects, data sets, and evaluators, to help developers accelerate their development process and make informed decisions when working with LLMs.
Full Transcript
hi this is Lance lanching this is our second video on Lang Smith evaluation I'm going to walk through kind the core Primitives or the basic components of lsmith to give you a sense of how to kind of build up your understanding from scratch so in the pirate video we talked about kind of landscape evaluations and the things you a want to do in terms of these four categories building data sets implementing evaluators um and then applying evals and of course specifying a task you care about so let's let's actually kind of build this up let's say have an LM app like have a task and rag is a very popular use case there is an index you do retrieval and then you do generation based on this the retrieve documents to produce an answer so it's question in answer out now the single unit of work for each of these steps we call a run so in this particular case there's two runs here one is question to documents and then documents to answer so it's indexing or retrieval and generation those are the two core steps so to speak SLE units will work runs can be tagged they can you can have feedback to runs you can have metadata to runs which we're going to talk about later now runs are rolled up into traces so traces just collection of runs um and for example in this particular case the rag app Trace would have the two runs the Run for the retrieval step the Run for the generation step that's kind of it and then a project is just a collection of traces for given app so let's say I had this rag app it was in production somewhere a bunch of users used basically used it um that all those traces would this be logged to that particular project so that's really it so kind of again I have an app it's a rag app it has two steps each step is a run the app going from you know input to Output is a trace that Trace contains the two runs and every time I run that app all those traces get rolled into into a project that's kind of it so those are the kind key key components of like of kind of the task component or the app component of this four you know these four pieces that we've been talking about now data sets here we kind of talked about the flavors of data set you might want manually curated from logs or synthetic but really at the core data sets are pretty simple they just have an input and optionally an output um so in the case like if you're doing a rag app you might have a data set with question answer pairs in that case there is an input and an output each of the pairs typically doesn't have to be is just like a for example a dict or a key value pair like question um your question answer your answer um now that's an example and the data set is just a collection of examples and as I just mentioned a lot of times the input outputs are just like key values you know so in the case of rag question answer you know key value pairs for my input and my output um there are other types of data sets that are interesting though chat and Ln in particular these are a little bit more relevant if you kind of want to do things like fine-tuning in which the data set requires a particular format like for for example chatter Ln format for a lot of applications we'll talk about key value is is completely fine and again your data set composed of examples each example just has an input and optionally an output that's really um and now evaluator so what's happening here we we kind of talk through a few different flavors here there's different kinds of Judges you can chw so like LM as a judge heuristic judges like function the human judge and then different modes like comparison comparing two different traces for example two different Generations um reference free so like there's no ground truth you give an llm judge a bunch of General criteria um or if Human been judge General criteria and then of course you can also provide ground truth so are kind of like the things you can think about in terms of evaluation now here's a very important piece where these all come together so like what's the information flow when you run an evaluation what's the evalu really doing so again our data sets composed of examples each example is an input and an output when you run an evaluation you take that input and you Plum it into your application so let's thing about a rag app for example the input's a question we Plum that into our rag chain we get some output answer that's that that's what you see on that bottom uh kind of in red now also you have your ground truth answer as an output in your data set that also gets plunged through to the evaluator so the evaluator which is kind of very intuitive has access to a grou answer in the case of this rag toy example and the Ln answer your rag chain answer and then it's doing some judging at the two now this is where there's a lot of different interesting options here you can build a custom evaluator like we talked about you can also use a bunch of off-the-shelf lsmith evaluators to do the grading so in this particular case we have an answer from you know our LM we have a ground truth answer and we want to use a built-in evaluator we can use one of the evaluators that are label Centric so they are like tuned or or designed to do uh comparison between like an Ln output and a groud truth output and we'll talk about the various options later but I just want to give you a flavor of really what's happening here is you have your data set of examples you're passing the you know the expected in this particular case example to your judge um you have your app which is receiving input from your data set it's producing its own output so now you have an output from your app you have the ground truth output you pass them to a judge a judge make a decision and outputs effectively a some kind of score that's really it that's the big picture for how to think about the information flow when doing evaluations and that's really it you know for like the core Primitives this is the key thing to understand and once you understand this everything else is kind of is pretty easy um so we're going to be talking about a little bit more detail and and show some code examples in the next video thank you
Original Description
With the rapid pace of AI, developers are often faced with a paradox of choice: how to choose the right prompt, how to trade-off LLM quality vs cost? Evaluations can accelerate development with structured process for making these decisions. But, we've heard that it is challenging to get started. So, we are launching a series of short videos focused on explaining how to perform evaluations using LangSmith.
This video introduces the primary components of LangSmith evaluation, including tracing (along with metadata, feedback, tags), datasets, and evaluators.
Documentation:
https://docs.smith.langchain.com/tracing/concepts
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from LangChain · LangChain · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Chat With Your Documents Using LangChain + JavaScript
LangChain
LangChain SQL Webinar
LangChain
LangChain "OpenAI functions" Webinar
LangChain
LangSmith Launch
LangChain
LangChain x Pinecone: Supercharging Llama-2 with RAG
LangChain
LangChain Expression Language
LangChain
Building LLM applications with LangChain with Lance
LangChain
Benchmarking Question/Answering Over CSV Data
LangChain
LangChain "RAG Evaluation" Webinar
LangChain
Fine-tuning in Your Voice Webinar
LangChain
Tabular Data Retrieval
LangChain
Building an LLM Application with Audio by AssemblyAI
LangChain
Superagent Deepdive Webinar
LangChain
Lessons from Deploying LLMs with LangSmith
LangChain
Shortwave Assistant Deepdive Webinar
LangChain
Cognitive Architectures for Language Agents
LangChain
Effectively Building with LLMs in the Browser with Jacob
LangChain
Data Privacy for LLMs
LangChain
"Theory of Mind" Webinar with Plastic Labs
LangChain
LangChain Templates
LangChain
Using Natural Language to Query Postgres with Jacob
LangChain
Building a Research Assistant from Scratch
LangChain
Benchmarking RAG over LangChain Docs
LangChain
Skeleton-of-Thought: Building a New Template from Scratch
LangChain
Benchmarking Methods for Semi-Structured RAG
LangChain
LangSmith Highlights: Getting Started
LangChain
LangSmith Highlights: Debugging
LangChain
LangSmith Highlights: Datasets
LangChain
LangSmith Highlights: Evaluation
LangChain
LangSmith Highlights: Human Annotation
LangChain
LangSmith Highlights: Monitoring
LangChain
LangSmith Highlights: Hub
LangChain
SQL Research Assistant
LangChain
Getting Started with Multi-Modal LLMs
LangChain
Build a Full Stack RAG App With TypeScript
LangChain
Auto-Prompt Builder (with Hosted LangServe)
LangChain
LangChain v0.1.0 Launch: Introduction
LangChain
LangChain v0.1.0 Launch: Observability
LangChain
LangChain v0.1.0 Launch: Integrations
LangChain
LangChain v0.1.0 Launch: Composability
LangChain
LangChain v0.1.0 Launch: Streaming
LangChain
LangChain v0.1.0 Launch: Output Parsing
LangChain
LangChain v0.1.0 Launch: Retrieval
LangChain
LangChain v0.1.0 Launch: Agents
LangChain
Build and Deploy a RAG app with Pinecone Serverless
LangChain
Hosted LangServe + LangChain Templates
LangChain
LangGraph: Intro
LangChain
LangGraph: Agent Executor
LangChain
LangGraph: Chat Agent Executor
LangChain
LangGraph: Human-in-the-Loop
LangChain
LangGraph: Dynamically Returning a Tool Output Directly
LangChain
LangGraph: Respond in a Specific Format
LangChain
LangGraph: Managing Agent Steps
LangChain
LangGraph: Force-Calling a Tool
LangChain
LangGraph: Multi-Agent Workflows
LangChain
Streaming Events: Introducing a new `stream_events` method
LangChain
Building a web RAG chatbot: using LangChain, Exa (prev. Metaphor), LangSmith, and Hosted Langserve
LangChain
OpenGPTs
LangChain
Open Source RAG with Nomic's New Embedding Model (and ChromaDB and Ollama)
LangChain
LangGraph: Persistence
LangChain
More on: LLM Foundations
View skill →Related Reads
📰
📰
📰
📰
The AI Crash Test: adversarial LLM testing you can audit in the Network tab
Dev.to · Erik Hill
[Day 17] I analyzed 33,469 of my own AI conversations to audit how I actually use AI
Dev.to · PEPPERCORN
Active players looked real until we asked which sessions counted
Dev.to · Michael Truong
Building Multimodal SuperAgents: Integrating Speech, OCR, and Translation with iFly-Skills
Dev.to AI
🎓
Tutor Explanation
DeepCamp AI