Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
驚愕の事実!LangChainが抱える問題 / Problems of LangChain
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Henry Cui
August 26, 2023
Programming
310
0
Share
驚愕の事実!LangChainが抱える問題 / Problems of LangChain
Henry Cui
August 26, 2023
More Decks by Henry Cui
See All by Henry Cui
プロダクション言語モデルの情報を盗む攻撃 / Stealing Part of a Production Language Model
zchenry
1
250
Direct Preference Optimization
zchenry
0
450
Diffusion Model with Perceptual Loss
zchenry
0
510
レンズの下のLLM / LLM under the Lens
zchenry
0
230
Go with the Prompt Flow
zchenry
0
220
Mojo Dojo
zchenry
0
260
ことのはの力で画像の異常検知 / Anomaly Detection by Language
zchenry
0
700
MLOps初心者がMLflowを触る / MLflow Brief Introduction
zchenry
0
180
{{guidance}}のガイダンス / Guidance of guidance
zchenry
0
200
Other Decks in Programming
See All in Programming
Claude Codeをカスタムして自分だけのClaude Codeを作ろう
terisuke
0
140
AI時代のエンジニアリングの原則 / Engineering Principles in the AI Era
haru860
0
460
瑠璃の宝石に学ぶ技術の声の聴き方 / 【劇場版】アニメから得た学びを発表会2026 #エンジニアニメ
mazrean
0
260
ついに来た!本格的なマルチクラウド時代の Google Cloud
maroon1st
0
140
PicoRuby for IoT: Connecting to the Cloud with MQTT
yuuu
2
610
Xdebug と IDE による デバッグ実行の仕組みを見る / Exploring-How-Debugging-Works-with-Xdebug-and-an-IDE
shin1x1
0
380
PHPで TLSのプロトコルを実装してみるをもう一度しゃべりたい
higaki_program
0
210
AWS re:Invent 2025の少し振り返り + DevOps AgentとBacklogを連携させてみた
satoshi256kbyte
3
160
ハーネスエンジニアリングとは?
kinopeee
11
5.6k
🦞OpenClaw works with AWS
licux
1
140
tRPCの概要と少しだけパフォーマンス
misoton665
2
210
UIの境界線をデザインする | React Tokyo #15 メイントーク
sasagar
2
370
Featured
See All Featured
The Curious Case for Waylosing
cassininazir
0
310
Context Engineering - Making Every Token Count
addyosmani
9
840
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
370
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.6k
Making Projects Easy
brettharned
120
6.6k
Un-Boring Meetings
codingconduct
0
270
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
380
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
140
Product Roadmaps are Hard
iamctodd
PRO
55
12k
Design in an AI World
tapps
1
200
Transcript
驚愕の事実!LangChainが抱える問題 機械学習の社会実装勉強会第26回 Henry 2023/8/26
記事の紹介 ▪ The Problem With LangChain • https://minimaxir.com/2023/07/langchain-problem/ • BuzzFeed社のエンジニアが執筆
▪ 記事が言いたいこと • LangChainは思うほど使いやすくない • 過度な複雑さと避けるために、APIをそのまま使うべき ▪ 断り:あくまでも記事の意見であって、発表者の意見ではない 2
内容 ▪ LangChainが実現したReAct論文 ▪ LangChainのテンプレート ▪ LangChainの履歴保存 ▪ LangChain Agentに関して
▪ 環境情報 • Python 3.8.6 • langchain 0.0.266 3
LangChainが実現したReAct論文 ▪ ReAct: Synergizing Reasoning and Acting in Language Models
• ICLR 2023 上位論文 ▪ タスクに対して、ReasoningとActを交互に行う 4
LangChainが実現したReAct論文 ▪ 著者実装は https://github.com/ysymyth/ReAct にて公開 ▪ 論文実験用なので、ハードコーディングのところがある • https://github.com/ysymyth/ReAct/blob/master/hotpotqa.ipynb 5
LangChainのテンプレート ▪ 記事の主な批判「LangChainが簡単なことを複雑化した」 ▪ その一例として、Templateの作り方に対して ▪ langchain/langchain/prompts/base.py • f-stringはstring.Formatterベース •
jinja2はjinja2.Templateでレンダーリング 6
LangChainの履歴保存 ▪ 履歴を保存するためのコードは逆に長くなっている • 左:LangChain、右:OpenAI API 7
LangChain Agentに関して ▪ initialize_agentではデフォルトでsystem promptを入れてない • system promptを含むagent_kwargsを明示的に渡す必要がある ▪ Tool選択の際で、出力がJSONじゃないといけない
• langchain/langchain/agents/conversational_chat/prompt.py 8
LangChain Agentに関して ▪ Tool選択の際で、出力がJSONじゃないといけない • Custom AgentやCustom Chainなどを使うことができるが、やることが また複雑になってしまう •
function callingも使える? ▪ function callingは6/13にAPIで公開 ▪ 記事の日付は7/14だが、内容が固まったのはfunction calling公開前だと思われる • 自由フォーマットの内容をJSONにパースするのにもう一回LLMも使え る? 9
まとめ ▪ LangChainに関する記事の検証 10