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
Henry Cui
August 26, 2023
Programming
320
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
710
MLOps初心者がMLflowを触る / MLflow Brief Introduction
zchenry
0
200
{{guidance}}のガイダンス / Guidance of guidance
zchenry
0
200
Other Decks in Programming
See All in Programming
運転動画を検索可能にする〜Cosmos-Embed1とDatabricks Vector Searchで〜/cosmos-embed1-databricks-vector-search
studio_graph
3
960
GoogleCloudとterraform完全に理解した
terisuke
1
200
From Formal Specification to Property Based Test
ohbarye
0
2.6k
〜バイブコーディングを超えて〜 チームで実験し続けたAI駆動開発
tigertora7571
0
210
Skillは並べた。動かなかった。契約で繋いだ。— 65個のSkillから、自走する開発サイクルへ
junholee
0
610
[RubyKaigi 2026] Require Hooks
palkan
1
320
Sans tests, vos agents ne sont pas fiables
nabondance
0
130
🦞OpenClaw works with AWS
licux
1
370
[BalkanRuby 2026] Drop your app/services!
palkan
2
310
ReactとSvelteのその先、Ripple-TS / Beyond React and Svelte: Ripple-TS
ssssota
0
130
エラー処理の温故知新 / history of error handling technic
ryotanakaya
7
1.9k
KMP × Kotlin 2.3 - How Android Got Slower While iOS Builds Improved by 47%
rio432
0
200
Featured
See All Featured
Code Review Best Practice
trishagee
74
20k
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
700
Embracing the Ebb and Flow
colly
88
5k
How to Talk to Developers About Accessibility
jct
2
200
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
280
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
390
Six Lessons from altMBA
skipperchong
29
4.2k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.2k
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
360
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
290
Java REST API Framework Comparison - PWX 2021
mraible
34
9.3k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
530
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