# 老金出海 · AI & Cross-border (https://www.laojinchuhai.com/en) > 老金出海 — AI 驱动的跨境出海实战平台。提供 AI 落地方法、大模型教程、AI 人物深度访谈。 > Laojin Chuhai — AI-powered going-global playbooks: LLM tutorials, AI founder interviews, cross-border AI ops. ## Core pages - [首页 Home](https://www.laojinchuhai.com/en) - [AI 资讯 Insights](https://www.laojinchuhai.com/en/insights) - [经典回放 Classics](https://www.laojinchuhai.com/en/classics) - [经典教程 Tutorials](https://www.laojinchuhai.com/en/tutorials) - [老金精选 Picks](https://www.laojinchuhai.com/en/picks) - [AI 网址导航 Directory](https://www.laojinchuhai.com/en/nav) - [人物索引 People](https://www.laojinchuhai.com/en/people) - [AI 工具 Tools](https://www.laojinchuhai.com/en/tools) - [产品 Products](https://www.laojinchuhai.com/en/products) - [专题专区 Topic hubs](https://www.laojinchuhai.com/en/hubs): Living product hubs kept current - [DeepSeek Harness](https://www.laojinchuhai.com/en/deepseek-harness): What dsh is, how to install it, and how it sits next to Claude Code and Cursor. Official links, tutorials and news. - [Pi Agent](https://www.laojinchuhai.com/en/pi-agent): Mario Zechner's minimal open-source coding agent: 4 base tools, TS extensions, skills & SDK embedding. - [OpenCode](https://www.laojinchuhai.com/en/opencode): Terminal TUI + desktop + IDE open coding agent across any LLM, MIT. - [OpenClaw 🦞](https://www.laojinchuhai.com/en/openclaw): A personal AI assistant on your devices, connecting WhatsApp/Telegram/Slack via a local Gateway. - [Hermes Agent ☤](https://www.laojinchuhai.com/en/hermes-agent): Nous Research's self-improving agent: learning loop, persistent memory, any model. - [Claude Code Ecosystem](https://www.laojinchuhai.com/en/claude-code): Anthropic's official terminal agent (closed), with a largely open Skills/hooks/MCP ecosystem — the benchmark. - [Aider](https://www.laojinchuhai.com/en/aider): Paul Gauthier's veteran AI pair-programming agent: every change a reviewable git diff. - [MCP Ecosystem](https://www.laojinchuhai.com/en/mcp): Model Context Protocol: the standard client-server interface connecting AI to tools and data. - [Gemini CLI](https://www.laojinchuhai.com/en/gemini-cli): Google's official open-source terminal agent: Apache-2.0, built-in search and MCP, generous free tier — the second knife beside Claude Code. - [Cursor](https://www.laojinchuhai.com/en/cursor): Anysphere's AI-native IDE: completion, chat and agent in one — a de-facto standard for storefronts and small tools. - [n8n](https://www.laojinchuhai.com/en/n8n): n8n, licensing and deployment choices; download a 12-case synthetic inquiry workflow with version-specific CLI evidence. GUI and production still need validation. - [Dify](https://www.laojinchuhai.com/en/dify): Dify, licensing and knowledge Q&A; six bilingual synthetic FAQs with retrieval, citation and review steps. Docs and offline tests checked; Dify and models not run. - [Ollama](https://www.laojinchuhai.com/en/ollama): What Ollama is, how to install it, and how it compares with Dify and n8n. MIT runtime; data stays local by default. - [LangChain](https://www.laojinchuhai.com/en/langchain): What LangChain is, how to install it, and how it compares with the OpenAI Agents SDK and Dify. MIT framework, not a model brand. - [Agent Skills](https://www.laojinchuhai.com/en/agent-skills): What Agent Skills are, how to write SKILL.md, and how they differ from MCP and Claude Code. Spec at agentskills.io. - [OpenAI Agents SDK](https://www.laojinchuhai.com/en/openai-agents-sdk): What the OpenAI Agents SDK is, how to install it, and how it compares with LangChain and Claude Code. Package openai-agents — not ChatGPT. ## Topics - [LLMs](https://www.laojinchuhai.com/en/topic/llm): LLM capabilities, products and best practices - [Agents](https://www.laojinchuhai.com/en/topic/agents): Building, orchestrating and shipping AI agents - [Open Source](https://www.laojinchuhai.com/en/topic/open-source): Open models, frameworks and ecosystems - [Infra](https://www.laojinchuhai.com/en/topic/infra): Compute, inference engines and serving - [Reasoning](https://www.laojinchuhai.com/en/topic/reasoning): Model reasoning, chain-of-thought and deep thinking - [AI Safety](https://www.laojinchuhai.com/en/topic/safety): Alignment, bias and responsible AI - [Computer Vision](https://www.laojinchuhai.com/en/topic/vision): Visual understanding, generation and robotics - [Multimodal](https://www.laojinchuhai.com/en/topic/multimodal): Understanding across text, image, audio and video - [Reinforcement Learning](https://www.laojinchuhai.com/en/topic/reinforcement): RL, reward models and self-play - [Engineering](https://www.laojinchuhai.com/en/topic/engineering): APIs, prompting and system design - [Founder Talks](https://www.laojinchuhai.com/en/topic/founder-topic): AI founders' thinking and judgment - [China AI](https://www.laojinchuhai.com/en/topic/china-ai): Chinese AI companies and ecosystem - [Foundations](https://www.laojinchuhai.com/en/topic/foundation): Beginner-friendly foundations - [Hardware](https://www.laojinchuhai.com/en/topic/hardware): AI chips, GPUs and compute hardware - [OpenAI](https://www.laojinchuhai.com/en/topic/openai): OpenAI models and ecosystem ## People - [OpenAI](https://www.laojinchuhai.com/en/people/openai): Creator of ChatGPT & GPT models - [Anthropic](https://www.laojinchuhai.com/en/people/anthropic): Creator of Claude - [Google DeepMind](https://www.laojinchuhai.com/en/people/google-deepmind): AlphaGo & Gemini research team - [Google](https://www.laojinchuhai.com/en/people/google): Creator of Gemini & AI Studio - [Meta AI](https://www.laojinchuhai.com/en/people/meta-ai): Creator of Llama open models - [Microsoft](https://www.laojinchuhai.com/en/people/microsoft): Creator of Azure AI & Copilot - [xAI](https://www.laojinchuhai.com/en/people/xai): Creator of Grok (Elon Musk) - [Mistral AI](https://www.laojinchuhai.com/en/people/mistral): European open-weights LLM lab - [Hugging Face](https://www.laojinchuhai.com/en/people/hugging-face): Open-source AI community & platform - [NVIDIA](https://www.laojinchuhai.com/en/people/nvidia): GPUs & AI compute infrastructure - [Perplexity](https://www.laojinchuhai.com/en/people/perplexity): AI search engine - [Scale AI](https://www.laojinchuhai.com/en/people/scale-ai): AI data infrastructure platform - [World Labs](https://www.laojinchuhai.com/en/people/world-labs): Spatial intelligence lab (Fei-Fei Li) - [Safe Superintelligence](https://www.laojinchuhai.com/en/people/ssi): Safe AGI lab (Ilya Sutskever) - [月之暗面(Kimi)](https://www.laojinchuhai.com/en/people/moonshot): Creator of Kimi LLMs - [DeepSeek](https://www.laojinchuhai.com/en/people/deepseek): Open-weights LLM lab - [智谱 AI](https://www.laojinchuhai.com/en/people/zhipu): Creator of GLM models - [MiniMax](https://www.laojinchuhai.com/en/people/minimax): Multimodal LLM lab - [百川智能](https://www.laojinchuhai.com/en/people/baichuan): Medical AI + LLM lab - [零一万物](https://www.laojinchuhai.com/en/people/zero-one): Open-weights LLM lab (Kai-Fu Lee) - [阶跃星辰](https://www.laojinchuhai.com/en/people/stepfun): Multimodal LLM lab - [阿里通义](https://www.laojinchuhai.com/en/people/tongyi): Creator of Qwen models - [梁文锋](https://www.laojinchuhai.com/en/people/liang-wenfeng): DeepSeek founder - [Mario Zechner](https://www.laojinchuhai.com/en/people/mario-zechner): Creator of Pi Coding Agent, libGDX, RoboVM - [OpenCode](https://www.laojinchuhai.com/en/people/opencode): Open-source coding agent team (ex-SST) - [OpenClaw](https://www.laojinchuhai.com/en/people/openclaw): Personal AI assistant (OpenClaw Foundation) - [Nous Research](https://www.laojinchuhai.com/en/people/nous-research): Research lab behind Hermes Agent - [Paul Gauthier](https://www.laojinchuhai.com/en/people/paul-gauthier): Aider creator - [杨植麟](https://www.laojinchuhai.com/en/people/yang-zhilin): Moonshot AI (Kimi) CEO - [李开复](https://www.laojinchuhai.com/en/people/kai-fu-lee): 01.AI founder; ex-Google China president - [王小川](https://www.laojinchuhai.com/en/people/wang-xiaochuan): Baichuan founder; ex-Sogou CEO - [闫俊杰](https://www.laojinchuhai.com/en/people/yan-junjie): MiniMax founder/CEO - [张鹏](https://www.laojinchuhai.com/en/people/zhang-peng): Zhipu AI CEO - [印奇](https://www.laojinchuhai.com/en/people/yin-qi): StepFun chairman; Megvii co-founder - [李彦宏](https://www.laojinchuhai.com/en/people/robin-li): CEO of Baidu - [周鸿祎](https://www.laojinchuhai.com/en/people/zhou-hongyi): Founder of 360 - [余凯](https://www.laojinchuhai.com/en/people/yu-kai): Horizon Robotics founder/CEO - [贾扬清](https://www.laojinchuhai.com/en/people/jia-yangqing): Lepton AI founder; ex-Alibaba VP - [陆奇](https://www.laojinchuhai.com/en/people/lu-qi): MiraclePlus founder; ex-Baidu president - [沈向洋](https://www.laojinchuhai.com/en/people/shen-xiangyang): IDEA chair; ex-Microsoft EVP ## Classics (AI interviews) - [Sam Altman on GPT-5, Sora and the board saga](https://www.laojinchuhai.com/en/classics/sam-altman-lex-fridman-419) (2024-03-18) - [Sam Altman on Sora, energy, and building an AI empire](https://www.laojinchuhai.com/en/classics/sam-altman-a16z-2025) (2025-10-08) - [Sam Altman on AGI, Compute Race and Physical AI](https://www.laojinchuhai.com/en/classics/sam-altman-invest-like-the-best-2026) (2026-07-28) - [Sam Altman on building OpenAI & betting on the impossible](https://www.laojinchuhai.com/en/classics/sam-altman-founders-2026) (2026-08-23) - [Demis Hassabis: We're three quarters of the way to AGI](https://www.laojinchuhai.com/en/classics/demis-hassabis-sequoia-2026) (2026-04-29) - [Mustafa Suleyman on whether AI will save or end humanity](https://www.laojinchuhai.com/en/classics/mustafa-suleyman-trevor-noah) (2025-09-18) - [Jensen Huang's vision for the future](https://www.laojinchuhai.com/en/classics/jensen-huang-cleo-abram) (2025-01-27) - [Fei-Fei Li on spatial intelligence and large world models](https://www.laojinchuhai.com/en/classics/feifei-li-bloomberg-2026) (2026-06-04) - [Dario Amodei on Claude, AGI and the future of AI & humanity](https://www.laojinchuhai.com/en/classics/dario-amodei-lex-fridman-452) (2024-11-11) - [Elon Musk on AI, war and humanity's future](https://www.laojinchuhai.com/en/classics/elon-musk-lex-fridman-400) (2023-11-09) - [Elon Musk on Grok, Optimus and AI evolution](https://www.laojinchuhai.com/en/classics/elon-musk-all-in-2025) (2025-09-10) - [Aravind Srinivas on AI search and the future of knowledge](https://www.laojinchuhai.com/en/classics/aravind-srinivas-jre-2026) (2026-07-01) - [Bret Taylor on AI agents, outcome-based pricing and the OpenAI board](https://www.laojinchuhai.com/en/classics/bret-taylor-stripe-2026) (2026-03-10) - [Andrew Ng on the rise of AI agents and agentic reasoning](https://www.laojinchuhai.com/en/classics/andrew-ng-agentic-reasoning) (2024-11-19) - [Kai-Fu Lee on how China is shaping the future of AI](https://www.laojinchuhai.com/en/classics/kai-fu-lee-diamandis-2024) (2024-12-05) - [Robin Li on application-driven AI innovation](https://www.laojinchuhai.com/en/classics/robin-li-wgs-2025) (2025-02-25) - [Eric Schmidt on the AI revolution: geopolitics, military & energy](https://www.laojinchuhai.com/en/classics/eric-schmidt-princeton-2026) (2026-05-22) - [Karpathy: Software Is Changing, Again (Software 3.0)](https://www.laojinchuhai.com/en/classics/karpathy-software-3) (2025-06-18) - [Intro to Large Language Models](https://www.laojinchuhai.com/en/classics/karpathy-intro-to-llms) (2023-11-22) - [Let's build GPT from scratch, in code](https://www.laojinchuhai.com/en/classics/karpathy-lets-build-gpt) (2023-01-17) - [Deep Dive into LLMs like ChatGPT](https://www.laojinchuhai.com/en/classics/karpathy-deep-dive-llms) (2025-02-05) - [Karpathy: from vibe coding to agentic engineering](https://www.laojinchuhai.com/en/classics/karpathy-vibe-coding-agentic-engineering) (2026-04-29) - [Ilya Sutskever: An Observation on Generalization](https://www.laojinchuhai.com/en/classics/ilya-observation-on-generalization) (2023-08-14) - [Geoffrey Hinton: Will AI outsmart human intelligence?](https://www.laojinchuhai.com/en/classics/geoffrey-hinton-royal-institution-2025) (2025-07-22) - [Yann LeCun: LLMs won't lead to AGI](https://www.laojinchuhai.com/en/classics/yann-lecun-kara-swisher-2024) (2024-12-22) - [Jeff Dean on AI's next transformations](https://www.laojinchuhai.com/en/classics/jeff-dean-sequoia-2025) (2025-05-12) - [Richard Sutton: Father of RL thinks LLMs are a dead end](https://www.laojinchuhai.com/en/classics/richard-sutton-dwarkesh-2025) (2025-09-26) - [Clem Delangue on why AI can't stay locked behind big APIs](https://www.laojinchuhai.com/en/classics/clem-delangue-turing-post-2026) (2026-05-01) - [Nat Friedman & Daniel Gross on the real signals in AI investing](https://www.laojinchuhai.com/en/classics/nat-friedman-daniel-gross-stripe-2026) (2026-05-19) - [Liang Wenfeng: Inside DeepSeek — China's most radical tech idealist](https://www.laojinchuhai.com/en/classics/liang-wenfeng-anchorage-2024) (2024-07-17) ## Tutorials - [Claude Code Skills workflow: turn team process into SKILL.md](https://www.laojinchuhai.com/en/tutorials/claude-code-skills-workflow): Skills are Claude Code's most valuable asset: write how-to as triggerable, installable files; triggering is ~70% description. - [Claude Code vs open alternatives: commercial or transparent](https://www.laojinchuhai.com/en/tutorials/claude-code-vs-open-source): Closed product, richest ecosystem. Pick managed, or pick auditability with OpenCode/Pi/Aider. - [Aider Quickstart: git-diff pair programming](https://www.laojinchuhai.com/en/tutorials/aider-quickstart): Every change a reviewable git diff. Install via pip, pick a model, edit by chat. - [Aider vs terminal agents: git flow vs multi-surface vs minimal](https://www.laojinchuhai.com/en/tutorials/aider-vs-terminal-agents): Aider = git diff + light; Pi = minimal embeddable; OpenCode = multi-surface; Claude Code = commercial. - [MCP intro: client-server and the three primitives](https://www.laojinchuhai.com/en/tutorials/mcp-intro-and-architecture): MCP is the standard protocol connecting AI to tools. Learn the client-server model and three primitives first. - [MCP in practice: one inquiry tool with list/call shape](https://www.laojinchuhai.com/en/tutorials/mcp-build-a-server): The same synthetic inquiry policy as an MCP tool JSON. 12 offline results match the oracle; no live client or SDK transport. - [OpenCode Quickstart: the open multi-surface coding agent](https://www.laojinchuhai.com/en/tutorials/opencode-quickstart): Open transparency plus out-of-box polish. Install, connect any LLM, and close one task in the TUI. - [OpenCode vs Pi vs Claude Code: multi-surface vs minimal vs commercial](https://www.laojinchuhai.com/en/tutorials/opencode-vs-pi-vs-claude-code): Three terminal agents, three routes: open multi-surface, minimal embeddable, commercial managed. - [OpenClaw Quickstart: put a personal assistant on your devices](https://www.laojinchuhai.com/en/tutorials/openclaw-quickstart): Three steps: onboard, gateway, dashboard. A personal assistant on your own devices. - [OpenClaw Gateway & channels: Telegram/WhatsApp in one step](https://www.laojinchuhai.com/en/tutorials/openclaw-gateway-channels): The local Gateway is the control plane; channels bring the assistant into your existing chats. - [Hermes Agent Quickstart: a memory-driven self-improving agent](https://www.laojinchuhai.com/en/tutorials/hermes-agent-quickstart): Nous Research's self-improving agent: full installer, hermes model to switch, learns you over time. - [Hermes learning loop: why it knows you better over time](https://www.laojinchuhai.com/en/tutorials/hermes-agent-learning-loop): Auto-built skills, self-improvement in use, FTS5 search + LLM summary, Honcho user modeling. - [Google Gemini API Quickstart: From AI Studio to Your First Request](https://www.laojinchuhai.com/en/tutorials/google-gemini-api-quickstart): A practical companion to Google's official quickstart: create a key, protect it, make a text request, and turn the prototype into a maintainable app. - [GPT API Quickstart: Build a Reliable Minimum Loop with OpenAI's Guide](https://www.laojinchuhai.com/en/tutorials/openai-gpt-api-quickstart): Do not start with a complex agent. Secure the key, call the Responses API, handle failures, then add structured outputs and tools one layer at a time. - [GPT Prompt Engineering: Turn Good Chat into an Evaluable Workflow](https://www.laojinchuhai.com/en/tutorials/openai-prompt-engineering-guide): Prompting is not magic phrasing. Use clear tasks, references, constraints, examples, and evals to turn a lucky answer into a repeatable workflow. - [Claude API Getting Started: From the First Message to Reliable Long-Context Work](https://www.laojinchuhai.com/en/tutorials/anthropic-claude-api-get-started): Use Anthropic's official getting-started path to understand the Messages API, system prompts, long inputs, and tool boundaries. - [The Hugging Face LLM Course: From Model Calls to Your Own Evaluation Set](https://www.laojinchuhai.com/en/tutorials/huggingface-llm-course-first-model): Do not reduce an open-model course to copying a notebook. Build transferable foundations from tokenizers and pipelines to pre-fine-tuning evaluation. - [Azure OpenAI Quickstart: Put GPT Behind Enterprise Access and Monitoring](https://www.laojinchuhai.com/en/tutorials/azure-openai-production-quickstart): The Azure version is about more than calling a model: resources, deployment names, identity, networking, and logs matter when a prototype becomes an enterprise service. - [Microsoft AI for Beginners: Complete 27-Lesson Course (MIT Licensed)](https://www.laojinchuhai.com/en/tutorials/microsoft-ai-for-beginners-full-course): The complete Microsoft open-source AI curriculum: symbolic AI, neural networks, computer vision, NLP, transformers, RL, multi-agent systems and AI ethics — all 27 lessons with links to the original source. - [Claude 3.7 Sonnet: Hybrid Reasoning & Coding Agents](https://www.laojinchuhai.com/en/tutorials/anthropic-claude-3-7-sonnet): Anthropic's first model with both quick answers and extended thinking. A guided reading of the official release and what hybrid reasoning means in production. - [Claude 3.5 Sonnet in Practice: From Chat to Agent Workflows](https://www.laojinchuhai.com/en/tutorials/anthropic-claude-3-5-sonnet): Claude 3.5 Sonnet balanced capability and cost in 2025, letting small teams move agents from experiments to daily tools. - [OpenAI's Reasoning Models Guide: When & How](https://www.laojinchuhai.com/en/tutorials/openai-reasoning-models-guide): Reasoning models (o1/o3) changed prompting rules — no more 'think step by step'. A guide to reasoning effort, structured outputs, and cost control. - [Google Gemini Agents Docs: Build Your First Agent](https://www.laojinchuhai.com/en/tutorials/google-gemini-agents-docs): Google's official agent development docs: from concepts to function calling and multi-tool orchestration in the Gemini ecosystem. - [Gemini API Docs Overview: Models, SDKs & Multimodality](https://www.laojinchuhai.com/en/tutorials/google-gemini-api-docs-overview): Google AI Studio and the Gemini API docs are one of the best starting points for multimodal LLMs. A guided tour of the docs and a learning path. - [Hugging Face Agents Course: Official Guide](https://www.laojinchuhai.com/en/tutorials/huggingface-agents-course): Hugging Face's official Agents Course — one of the most popular open-source agent tutorials of 2025. Unit-by-unit guide and learning path. - [Microsoft's Generative AI Learning Path](https://www.laojinchuhai.com/en/tutorials/microsoft-generative-ai-learning-path): Microsoft's official entry path: from generative AI concepts to Azure practice. A guided tour for building systematic foundations. - [Anthropic's Prompt Engineering Docs: Claude in Context](https://www.laojinchuhai.com/en/tutorials/anthropic-prompt-engineering-overview): Anthropic's official prompt engineering docs are the de facto reference for Claude development: six techniques to scenario templates. - [Pi Coding Agent Quickstart: 4 Base Tools & Minimal Terminal Workflow](https://www.laojinchuhai.com/en/tutorials/pi-agent-quickstart): Break free from commercial black boxes. Master the 4 base tools (read, write, edit, bash) for a clean, transparent terminal workflow. - [Pi Agent Extensions & Skills: Build Your First TypeScript Tool & Workflow](https://www.laojinchuhai.com/en/tutorials/pi-agent-extensions-and-skills): Deep dive into Pi's extension ecosystem: build custom tools with TypeScript, listen to event hooks, and package workflows as Skills. - [Pi Agent vs Claude Code vs Aider: Architecture & Selection Guide](https://www.laojinchuhai.com/en/tutorials/pi-agent-vs-claude-code): Commercial black box vs open hackability. Comparing tool architecture, SDK embeddability, session trees, and extension cost across three coding agents. - [DeepSeek Harness Quickstart: Boot the Web UI, Then Close One Repo Loop](https://www.laojinchuhai.com/en/tutorials/deepseek-harness-quickstart): Do not start by writing a plugin. Follow the official README: boot the dsh Web UI, add an API key, pick a workspace, then ask the agent to summarize the repo. - [DeepSeek Harness Architecture: Why ‘Everything Is a Plugin’ Is Not a Slogan](https://www.laojinchuhai.com/en/tutorials/deepseek-harness-architecture): Use the official architecture.md to explain profiles, bundles, the session log and turn/step. No package table dump — only where new behavior should attach. - [Your First DeepSeek Harness Plugin: Mount It Before You Productize](https://www.laojinchuhai.com/en/tutorials/deepseek-harness-first-plugin): Follow the official first-plugin tutorial through apply(ctx) and a Cordis overlay. No full step dump — only boundaries and what to do next. - [Gemini CLI Quickstart: Google's official terminal agent](https://www.laojinchuhai.com/en/tutorials/gemini-cli-quickstart): Install via npm, sign in with Google, and close one task in your repo. Free tier plus built-in search. - [Cursor Quickstart: Tab, Chat and Agent in one IDE](https://www.laojinchuhai.com/en/tutorials/cursor-quickstart): Download the desktop app, sign in, open a project, and ship your first tool with Tab, Cmd+L and Cmd+I. - [n8n inquiry-routing tutorial: 12 synthetic cases, review only](https://www.laojinchuhai.com/en/tutorials/n8n-quickstart): Download the workflow and oracle, check inputs, route reviews and handle failures. CLI-tested on n8n 2.37.10; GUI unverified, no customer data or sends. - [Dify knowledge-Q&A tutorial: supported inquiry drafts and unknowns](https://www.laojinchuhai.com/en/tutorials/dify-quickstart): Six bilingual synthetic FAQs, 26 questions and a complete UI checklist. 22 offline tests passed; Dify and models not run. A citation label is not factual proof. - [Ollama Quickstart: run an open model locally](https://www.laojinchuhai.com/en/tutorials/ollama-quickstart): Install the runtime, ollama run a model, chat. API defaults to localhost:11434. Validate on a small model first. - [LangChain Quickstart: install with uv, follow official docs](https://www.laojinchuhai.com/en/tutorials/langchain-quickstart): MIT framework. Official README recommends uv add langchain. Don't copy old APIs from stale blogs; LangGraph / LangSmith are related products, not the same package. - [Agent Skills Quickstart: a valid SKILL.md for synthetic inquiry review](https://www.laojinchuhai.com/en/tutorials/agent-skills-quickstart): name must equal folder inquiry-review. Offline tests check frontmatter and no-send rules; not installed in Claude Code. - [OpenAI Agents SDK Quickstart: complete Agent, Runner and inquiry tool](https://www.laojinchuhai.com/en/tutorials/openai-agents-sdk-quickstart): Source includes Agent, @tool and Runner.run. Offline 12-case policy check; openai-agents not installed and no model call. - [Local or cloud: record choice conditions without a benchmark](https://www.laojinchuhai.com/en/tutorials/local-or-cloud-ai-runtime): Four explicit fields yield hub starting points or insufficient information. Not a ranking, price or latency test. ## Latest insights (by updatedAt or date, 20) - [Frontier Daily (Oct 14): 8 items from Hacker News, DeepMind, Simon Willison and more](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-10-14) (2026-10-14) - [Frontier Daily (Oct 13): 7 items from GitHub (OpenAI), Hacker News, GitHub (Meta Llama) and more](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-10-13) (2026-10-13) - [Frontier Daily (Oct 12): 6 items from Hacker News, Simon Willison, Latent Space](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-10-12) (2026-10-12) - [Frontier Daily (Oct 11): 6 items from Hacker News, Latent Space, Simon Willison](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-10-11) (2026-10-11) - [Frontier Daily (Oct 10): 8 items from Hacker News, Simon Willison, OpenAI and more](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-10-10) (2026-10-10) - [Frontier Daily (Oct 9): 10 items from Simon Willison, Anthropic, GitHub (Anthropic) and more](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-10-09) (2026-10-09) - [Frontier Daily (Oct 8): 8 items from Simon Willison, Hacker News, Latent Space and more](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-10-08) (2026-10-08) - [Frontier Daily (Oct 7): 10 items from GitHub (Hugging Face), Simon Willison, DeepMind and more](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-10-07) (2026-10-07) - [Frontier Daily (Oct 6): 6 items from GitHub (vLLM), Hacker News, OpenAI and more](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-10-06) (2026-10-06) - [Frontier Daily (Oct 5): 4 items from Hacker News, Simon Willison](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-10-05) (2026-10-05) - [Frontier Daily (Oct 4): 5 items from Hacker News, Latent Space, Simon Willison](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-10-04) (2026-10-04) - [Frontier Daily (Oct 3): 7 items from Hacker News, Anthropic, OpenAI and more](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-10-03) (2026-10-03) - [Frontier Daily (Oct 2): 10 items from OpenAI, Hacker News, One Useful Thing and more](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-10-02) (2026-10-02) - [Frontier Daily (Oct 1): 10 items from Hacker News, DeepMind, OpenAI and more](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-10-01) (2026-10-01) - [Frontier Daily (Sep 30): 9 items from GitHub (Hugging Face), Hacker News, Simon Willison and more](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-09-30) (2026-09-30) - [Frontier Daily (Sep 29): 7 items from Simon Willison, Hacker News, OpenAI and more](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-09-29) (2026-09-29) - [Frontier Daily (Sep 28): 3 items from Hacker News, Simon Willison](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-09-28) (2026-09-28) - [Frontier Daily (Sep 27): 7 items from GitHub (OpenAI), Hacker News, Latent Space and more](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-09-27) (2026-09-27) - [Frontier Daily (Sep 26): 7 items from OpenAI, Hacker News, Simon Willison and more](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-09-26) (2026-09-26) - [Frontier Daily (Sep 25): 10 items from GitHub (Anthropic), Hacker News, DeepMind and more](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-09-25) (2026-09-25) ## Insights directory (268 URLs, not full text) - [frontier-daily-2026-10-14](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-10-14) - [frontier-daily-2026-10-13](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-10-13) - [frontier-daily-2026-10-12](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-10-12) - [frontier-daily-2026-10-11](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-10-11) - [frontier-daily-2026-10-10](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-10-10) - [frontier-daily-2026-10-09](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-10-09) - [frontier-daily-2026-10-08](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-10-08) - [frontier-daily-2026-10-07](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-10-07) - [frontier-daily-2026-10-06](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-10-06) - [frontier-daily-2026-10-05](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-10-05) - [frontier-daily-2026-10-04](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-10-04) - [frontier-daily-2026-10-03](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-10-03) - [frontier-daily-2026-10-02](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-10-02) - [frontier-daily-2026-10-01](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-10-01) - [frontier-daily-2026-09-30](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-09-30) - [frontier-daily-2026-09-29](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-09-29) - [frontier-daily-2026-09-28](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-09-28) - [frontier-daily-2026-09-27](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-09-27) - [frontier-daily-2026-09-26](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-09-26) - [frontier-daily-2026-09-25](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-09-25) - [frontier-daily-2026-09-24](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-09-24) - [frontier-daily-2026-09-23](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-09-23) - [frontier-daily-2026-09-22](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-09-22) - [frontier-daily-2026-09-20](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-09-20) - [shopify-store-launch-baseline](https://www.laojinchuhai.com/en/insights/shopify-store-launch-baseline) - [frontier-daily-2026-09-19](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-09-19) - [frontier-daily-2026-09-18](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-09-18) - [frontier-daily-2026-09-17](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-09-17) - [frontier-daily-2026-09-16](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-09-16) - [frontier-daily-2026-09-14](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-09-14) - [frontier-daily-2026-09-13](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-09-13) - [frontier-daily-2026-09-12](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-09-12) - [frontier-daily-2026-09-11](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-09-11) - [frontier-daily-2026-09-10](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-09-10) - [frontier-daily-2026-09-09](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-09-09) - [frontier-daily-2026-09-08](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-09-08) - [frontier-daily-2026-09-07](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-09-07) - [frontier-daily-2026-09-06](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-09-06) - [agent-skill-security-basics](https://www.laojinchuhai.com/en/insights/agent-skill-security-basics) - [ai-coding-assistants-comparison](https://www.laojinchuhai.com/en/insights/ai-coding-assistants-comparison) - [ai-content-localization-workflow](https://www.laojinchuhai.com/en/insights/ai-content-localization-workflow) - [dify-vs-langgraph-vs-agent-platforms](https://www.laojinchuhai.com/en/insights/dify-vs-langgraph-vs-agent-platforms) - [frontier-daily-2026-09-05](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-09-05) - [what-is-cursor](https://www.laojinchuhai.com/en/insights/what-is-cursor) - [what-is-gemini-cli](https://www.laojinchuhai.com/en/insights/what-is-gemini-cli) - [frontier-daily-2026-09-04](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-09-04) - [what-is-agent-skills](https://www.laojinchuhai.com/en/insights/what-is-agent-skills) - [what-is-dify](https://www.laojinchuhai.com/en/insights/what-is-dify) - [what-is-langchain](https://www.laojinchuhai.com/en/insights/what-is-langchain) - [what-is-n8n](https://www.laojinchuhai.com/en/insights/what-is-n8n) - [what-is-ollama](https://www.laojinchuhai.com/en/insights/what-is-ollama) - [what-is-openai-agents-sdk](https://www.laojinchuhai.com/en/insights/what-is-openai-agents-sdk) - [frontier-daily-2026-09-03](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-09-03) - [frontier-daily-2026-09-02](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-09-02) - [frontier-daily-2026-09-01](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-09-01) - [frontier-daily-2026-08-31](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-08-31) - [frontier-daily-2026-08-30](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-08-30) - [frontier-daily-2026-08-29](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-08-29) - [frontier-daily-2026-08-28](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-08-28) - [frontier-daily-2026-08-27](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-08-27) - [frontier-daily-2026-08-26](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-08-26) - [frontier-daily-2026-08-25](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-08-25) - [frontier-daily-2026-08-24](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-08-24) - [frontier-daily-2026-08-23](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-08-23) - [frontier-daily-2026-08-22](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-08-22) - [frontier-daily-2026-08-21](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-08-21) - [frontier-daily-2026-08-20](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-08-20) - [frontier-daily-2026-08-19](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-08-19) - [frontier-daily-2026-08-18](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-08-18) - [agent-browser-automation-skills](https://www.laojinchuhai.com/en/insights/agent-browser-automation-skills) - [frontier-daily-2026-08-17](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-08-17) - [agent-data-analysis-skills](https://www.laojinchuhai.com/en/insights/agent-data-analysis-skills) - [chatgpt-pro-delivery-skill](https://www.laojinchuhai.com/en/insights/chatgpt-pro-delivery-skill) - [five-step-dev-codex](https://www.laojinchuhai.com/en/insights/five-step-dev-codex) - [frontier-daily-2026-08-16](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-08-16) - [parallel-sessions-protocol](https://www.laojinchuhai.com/en/insights/parallel-sessions-protocol) - [session-rotation-maintainer](https://www.laojinchuhai.com/en/insights/session-rotation-maintainer) - [frontier-daily-2026-08-15](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-08-15) - [what-is-aider](https://www.laojinchuhai.com/en/insights/what-is-aider) - [what-is-claude-code-ecosystem](https://www.laojinchuhai.com/en/insights/what-is-claude-code-ecosystem) - [what-is-hermes-agent](https://www.laojinchuhai.com/en/insights/what-is-hermes-agent) - [what-is-mcp](https://www.laojinchuhai.com/en/insights/what-is-mcp) - [what-is-openclaw](https://www.laojinchuhai.com/en/insights/what-is-openclaw) - [what-is-opencode](https://www.laojinchuhai.com/en/insights/what-is-opencode) - [what-is-pi-coding-agent](https://www.laojinchuhai.com/en/insights/what-is-pi-coding-agent) - [frontier-daily-2026-08-14](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-08-14) - [frontier-daily-2026-08-13](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-08-13) - [what-is-deepseek-harness](https://www.laojinchuhai.com/en/insights/what-is-deepseek-harness) - [frontier-daily-2026-08-12](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-08-12) - [ai-meeting-notes-tools](https://www.laojinchuhai.com/en/insights/ai-meeting-notes-tools) - [five-step-claude-edition](https://www.laojinchuhai.com/en/insights/five-step-claude-edition) - [frontier-daily-2026-08-11](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-08-11) - [ai-customer-support-platforms](https://www.laojinchuhai.com/en/insights/ai-customer-support-platforms) - [ai-translation-vs-sales-generation](https://www.laojinchuhai.com/en/insights/ai-translation-vs-sales-generation) - [frontier-daily-2026-08-10](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-08-10) - [ai-for-procurement-teams](https://www.laojinchuhai.com/en/insights/ai-for-procurement-teams) - [frontier-daily-2026-08-09](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-08-09) - [ai-after-sales-customer-success](https://www.laojinchuhai.com/en/insights/ai-after-sales-customer-success) - [ai-email-inbox-workflow](https://www.laojinchuhai.com/en/insights/ai-email-inbox-workflow) - [frontier-daily-2026-08-08](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-08-08) - [agent-document-processing-skills](https://www.laojinchuhai.com/en/insights/agent-document-processing-skills) - [frontier-daily-2026-08-07](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-08-07) - [rag-knowledge-base-tools](https://www.laojinchuhai.com/en/insights/rag-knowledge-base-tools) - [agent-skill-evals-basics](https://www.laojinchuhai.com/en/insights/agent-skill-evals-basics) - [frontier-daily-2026-08-06](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-08-06) - [frontier-daily-2026-08-05](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-08-05) - [frontier-daily-2026-08-04](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-08-04) - [frontier-daily-2026-08-03](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-08-03) - [multilingual-sales-ai](https://www.laojinchuhai.com/en/insights/multilingual-sales-ai) - [frontier-daily-2026-08-02](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-08-02) - [frontier-daily-2026-08-01](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-08-01) - [codexloom-agent-team-best-practices](https://www.laojinchuhai.com/en/insights/codexloom-agent-team-best-practices) - [frontier-daily-2026-07-31](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-07-31) - [frontier-daily-2026-07-30](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-07-30) - [ai-content-operations-case](https://www.laojinchuhai.com/en/insights/ai-content-operations-case) - [customer-knowledge-ai-asset](https://www.laojinchuhai.com/en/insights/customer-knowledge-ai-asset) - [frontier-daily-2026-07-29](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-07-29) - [frontier-daily-2026-07-28](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-07-28) - [ai-sales-copilot-for-whatsapp-guide](https://www.laojinchuhai.com/en/insights/ai-sales-copilot-for-whatsapp-guide) - [frontier-daily-2026-07-27](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-07-27) - [multi-model-api-gateway-guide](https://www.laojinchuhai.com/en/insights/multi-model-api-gateway-guide) - [ai-agent-collaboration-patterns](https://www.laojinchuhai.com/en/insights/ai-agent-collaboration-patterns) - [cross-border-team-ai-stack](https://www.laojinchuhai.com/en/insights/cross-border-team-ai-stack) - [ai-growth-tools-stack](https://www.laojinchuhai.com/en/insights/ai-growth-tools-stack) - [frontier-daily-2026-07-25](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-07-25) - [marketing-skills-for-ai-agents](https://www.laojinchuhai.com/en/insights/marketing-skills-for-ai-agents) - [365skill-library-guide](https://www.laojinchuhai.com/en/insights/365skill-library-guide) - [frontier-daily-2026-07-24](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-07-24) - [sme-ai-adoption-roadmap](https://www.laojinchuhai.com/en/insights/sme-ai-adoption-roadmap) - [chatgpt-vs-dedicated-sales-ai](https://www.laojinchuhai.com/en/insights/chatgpt-vs-dedicated-sales-ai) - [frontier-daily-2026-07-23](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-07-23) - [liang-wenfeng-deepseek-investor-talk](https://www.laojinchuhai.com/en/insights/liang-wenfeng-deepseek-investor-talk) - [agent-workflow-orchestration-intro](https://www.laojinchuhai.com/en/insights/agent-workflow-orchestration-intro) - [frontier-daily-2026-07-22](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-07-22) - [shopify-ai-operations](https://www.laojinchuhai.com/en/insights/shopify-ai-operations) - [ai-skill-factory](https://www.laojinchuhai.com/en/insights/ai-skill-factory) - [frontier-daily-2026-07-21](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-07-21) - [what-are-agent-skills](https://www.laojinchuhai.com/en/insights/what-are-agent-skills) - [whatsapp-crm-comparison](https://www.laojinchuhai.com/en/insights/whatsapp-crm-comparison) - [frontier-daily-2026-07-20](https://www.laojinchuhai.com/en/insights/frontier-daily-2026-07-20) - [openrouter-alternatives](https://www.laojinchuhai.com/en/insights/openrouter-alternatives) - [write-custom-agent-skills](https://www.laojinchuhai.com/en/insights/write-custom-agent-skills) - [growth-team-ai-ops](https://www.laojinchuhai.com/en/insights/growth-team-ai-ops) - [sales-team-ai-whatsapp](https://www.laojinchuhai.com/en/insights/sales-team-ai-whatsapp) - [crewai-alternatives](https://www.laojinchuhai.com/en/insights/crewai-alternatives) - [frontier-2026-07-18](https://www.laojinchuhai.com/en/insights/frontier-2026-07-18) - [temu-in-ca](https://www.laojinchuhai.com/en/insights/temu-in-ca) - [pet-to-ca](https://www.laojinchuhai.com/en/insights/pet-to-ca) - [temu-in-kr](https://www.laojinchuhai.com/en/insights/temu-in-kr) - [pet-to-kr](https://www.laojinchuhai.com/en/insights/pet-to-kr) - [temu-in-jp](https://www.laojinchuhai.com/en/insights/temu-in-jp) - [pet-to-jp](https://www.laojinchuhai.com/en/insights/pet-to-jp) - [temu-in-de](https://www.laojinchuhai.com/en/insights/temu-in-de) - [pet-to-de](https://www.laojinchuhai.com/en/insights/pet-to-de) - [temu-in-uk](https://www.laojinchuhai.com/en/insights/temu-in-uk) - [pet-to-uk](https://www.laojinchuhai.com/en/insights/pet-to-uk) - [temu-in-us](https://www.laojinchuhai.com/en/insights/temu-in-us) - [pet-to-us](https://www.laojinchuhai.com/en/insights/pet-to-us) - [shopify-in-ae](https://www.laojinchuhai.com/en/insights/shopify-in-ae) - [outdoor-to-ae](https://www.laojinchuhai.com/en/insights/outdoor-to-ae) - [shopify-in-au](https://www.laojinchuhai.com/en/insights/shopify-in-au) - [outdoor-to-au](https://www.laojinchuhai.com/en/insights/outdoor-to-au) - [shopify-in-ca](https://www.laojinchuhai.com/en/insights/shopify-in-ca) - [outdoor-to-ca](https://www.laojinchuhai.com/en/insights/outdoor-to-ca) - [shopify-in-kr](https://www.laojinchuhai.com/en/insights/shopify-in-kr) - [outdoor-to-kr](https://www.laojinchuhai.com/en/insights/outdoor-to-kr) - [shopify-in-jp](https://www.laojinchuhai.com/en/insights/shopify-in-jp) - [outdoor-to-jp](https://www.laojinchuhai.com/en/insights/outdoor-to-jp) - [shopify-in-de](https://www.laojinchuhai.com/en/insights/shopify-in-de) - [outdoor-to-de](https://www.laojinchuhai.com/en/insights/outdoor-to-de) - [shopify-in-uk](https://www.laojinchuhai.com/en/insights/shopify-in-uk) - [outdoor-to-uk](https://www.laojinchuhai.com/en/insights/outdoor-to-uk) - [shopify-in-us](https://www.laojinchuhai.com/en/insights/shopify-in-us) - [outdoor-to-us](https://www.laojinchuhai.com/en/insights/outdoor-to-us) - [tiktok-shop-in-ae](https://www.laojinchuhai.com/en/insights/tiktok-shop-in-ae) - [home-to-ae](https://www.laojinchuhai.com/en/insights/home-to-ae) - [tiktok-shop-in-au](https://www.laojinchuhai.com/en/insights/tiktok-shop-in-au) - [home-to-au](https://www.laojinchuhai.com/en/insights/home-to-au) - [tiktok-shop-in-ca](https://www.laojinchuhai.com/en/insights/tiktok-shop-in-ca) - [home-to-ca](https://www.laojinchuhai.com/en/insights/home-to-ca) - [tiktok-shop-in-kr](https://www.laojinchuhai.com/en/insights/tiktok-shop-in-kr) - [home-to-kr](https://www.laojinchuhai.com/en/insights/home-to-kr) - [tiktok-shop-in-jp](https://www.laojinchuhai.com/en/insights/tiktok-shop-in-jp) - [home-to-jp](https://www.laojinchuhai.com/en/insights/home-to-jp) - [tiktok-shop-in-de](https://www.laojinchuhai.com/en/insights/tiktok-shop-in-de) - [home-to-de](https://www.laojinchuhai.com/en/insights/home-to-de) - [tiktok-shop-in-uk](https://www.laojinchuhai.com/en/insights/tiktok-shop-in-uk) - [guide-certificate-of-origin](https://www.laojinchuhai.com/en/insights/guide-certificate-of-origin) - [home-to-uk](https://www.laojinchuhai.com/en/insights/home-to-uk) - [home-to-us](https://www.laojinchuhai.com/en/insights/home-to-us) - [tiktok-shop-in-us](https://www.laojinchuhai.com/en/insights/tiktok-shop-in-us) - [amazon-in-ae](https://www.laojinchuhai.com/en/insights/amazon-in-ae) - [guide-export-ocean-charges](https://www.laojinchuhai.com/en/insights/guide-export-ocean-charges) - [3c-to-ae](https://www.laojinchuhai.com/en/insights/3c-to-ae) - [market-ae](https://www.laojinchuhai.com/en/insights/market-ae) - [3c-to-au](https://www.laojinchuhai.com/en/insights/3c-to-au) - [amazon-in-au](https://www.laojinchuhai.com/en/insights/amazon-in-au) - [guide-ddp-double-clearance](https://www.laojinchuhai.com/en/insights/guide-ddp-double-clearance) - [guide-hs-code-classification](https://www.laojinchuhai.com/en/insights/guide-hs-code-classification) - [kb-returns-aftersales](https://www.laojinchuhai.com/en/insights/kb-returns-aftersales) - [market-au](https://www.laojinchuhai.com/en/insights/market-au) - [amazon-in-ca](https://www.laojinchuhai.com/en/insights/amazon-in-ca) - [kb-cross-border-payment](https://www.laojinchuhai.com/en/insights/kb-cross-border-payment) - [3c-to-ca](https://www.laojinchuhai.com/en/insights/3c-to-ca) - [platform-ebay](https://www.laojinchuhai.com/en/insights/platform-ebay) - [guide-demurrage-detention](https://www.laojinchuhai.com/en/insights/guide-demurrage-detention) - [market-ca](https://www.laojinchuhai.com/en/insights/market-ca) - [amazon-in-kr](https://www.laojinchuhai.com/en/insights/amazon-in-kr) - [kb-listing-optimization](https://www.laojinchuhai.com/en/insights/kb-listing-optimization) - [guide-marine-insurance](https://www.laojinchuhai.com/en/insights/guide-marine-insurance) - [guide-telex-release](https://www.laojinchuhai.com/en/insights/guide-telex-release) - [guide-cbm-loadability](https://www.laojinchuhai.com/en/insights/guide-cbm-loadability) - [guide-sensitive-cargo-export](https://www.laojinchuhai.com/en/insights/guide-sensitive-cargo-export) - [3c-to-kr](https://www.laojinchuhai.com/en/insights/3c-to-kr) - [guide-lcl-revenue-ton](https://www.laojinchuhai.com/en/insights/guide-lcl-revenue-ton) - [3c-to-de](https://www.laojinchuhai.com/en/insights/3c-to-de) - [3c-to-jp](https://www.laojinchuhai.com/en/insights/3c-to-jp) - [3c-to-uk](https://www.laojinchuhai.com/en/insights/3c-to-uk) - [3c-to-us](https://www.laojinchuhai.com/en/insights/3c-to-us) - [amazon-in-de](https://www.laojinchuhai.com/en/insights/amazon-in-de) - [amazon-in-jp](https://www.laojinchuhai.com/en/insights/amazon-in-jp) - [amazon-in-uk](https://www.laojinchuhai.com/en/insights/amazon-in-uk) - [amazon-in-us](https://www.laojinchuhai.com/en/insights/amazon-in-us) - [kb-incoterms](https://www.laojinchuhai.com/en/insights/kb-incoterms) - [kb-overseas-warehouse-vs-direct](https://www.laojinchuhai.com/en/insights/kb-overseas-warehouse-vs-direct) - [kb-product-selection-framework](https://www.laojinchuhai.com/en/insights/kb-product-selection-framework) - [kb-vat-tax](https://www.laojinchuhai.com/en/insights/kb-vat-tax) - [kb-volumetric-weight](https://www.laojinchuhai.com/en/insights/kb-volumetric-weight) - [market-de](https://www.laojinchuhai.com/en/insights/market-de) - [market-jp](https://www.laojinchuhai.com/en/insights/market-jp) - [market-kr](https://www.laojinchuhai.com/en/insights/market-kr) - [market-uk](https://www.laojinchuhai.com/en/insights/market-uk) - [market-us](https://www.laojinchuhai.com/en/insights/market-us) - [platform-aliexpress](https://www.laojinchuhai.com/en/insights/platform-aliexpress) - [platform-amazon](https://www.laojinchuhai.com/en/insights/platform-amazon) - [platform-shopify](https://www.laojinchuhai.com/en/insights/platform-shopify) - [platform-temu](https://www.laojinchuhai.com/en/insights/platform-temu) - [platform-tiktok-shop](https://www.laojinchuhai.com/en/insights/platform-tiktok-shop) - [sourcing-competitor-teardown](https://www.laojinchuhai.com/en/insights/sourcing-competitor-teardown) - [listing-keyword-research](https://www.laojinchuhai.com/en/insights/listing-keyword-research) - [trade-buyer-research](https://www.laojinchuhai.com/en/insights/trade-buyer-research) - [ai-product-selection](https://www.laojinchuhai.com/en/insights/ai-product-selection) - [marketing-landing-page-copy](https://www.laojinchuhai.com/en/insights/marketing-landing-page-copy) - [supply-supplier-vetting](https://www.laojinchuhai.com/en/insights/supply-supplier-vetting) - [ai-listing-optimization](https://www.laojinchuhai.com/en/insights/ai-listing-optimization) - [distribution-factory-to-dtc](https://www.laojinchuhai.com/en/insights/distribution-factory-to-dtc) - [ai-cold-email-outreach](https://www.laojinchuhai.com/en/insights/ai-cold-email-outreach) - [sourcing-blue-ocean-data](https://www.laojinchuhai.com/en/insights/sourcing-blue-ocean-data) - [listing-multi-market-localization](https://www.laojinchuhai.com/en/insights/listing-multi-market-localization) - [tiktok-shop-ai-marketing](https://www.laojinchuhai.com/en/insights/tiktok-shop-ai-marketing) - [trade-quotation-negotiation](https://www.laojinchuhai.com/en/insights/trade-quotation-negotiation) - [cross-border-supply-chain-digital](https://www.laojinchuhai.com/en/insights/cross-border-supply-chain-digital) - [marketing-influencer-outreach](https://www.laojinchuhai.com/en/insights/marketing-influencer-outreach) - [distribution-ai-transformation](https://www.laojinchuhai.com/en/insights/distribution-ai-transformation) - [supply-inventory-forecasting](https://www.laojinchuhai.com/en/insights/supply-inventory-forecasting) - [distribution-reseller-enablement](https://www.laojinchuhai.com/en/insights/distribution-reseller-enablement) - [sourcing-seasonal-timing](https://www.laojinchuhai.com/en/insights/sourcing-seasonal-timing) - [listing-visual-brief](https://www.laojinchuhai.com/en/insights/listing-visual-brief) - [trade-show-followup](https://www.laojinchuhai.com/en/insights/trade-show-followup) - [marketing-email-lifecycle](https://www.laojinchuhai.com/en/insights/marketing-email-lifecycle) - [supply-logistics-selection](https://www.laojinchuhai.com/en/insights/supply-logistics-selection) - [distribution-private-domain](https://www.laojinchuhai.com/en/insights/distribution-private-domain) - [sourcing-compliance-screening](https://www.laojinchuhai.com/en/insights/sourcing-compliance-screening) - [listing-data-driven-iteration](https://www.laojinchuhai.com/en/insights/listing-data-driven-iteration) - [trade-multichannel-outreach](https://www.laojinchuhai.com/en/insights/trade-multichannel-outreach) - [marketing-ad-creative-matrix](https://www.laojinchuhai.com/en/insights/marketing-ad-creative-matrix) - [supply-overseas-warehouse](https://www.laojinchuhai.com/en/insights/supply-overseas-warehouse) - [distribution-ai-native-team](https://www.laojinchuhai.com/en/insights/distribution-ai-native-team) ## Directory (AI 网址导航 · going-global tools) - [ChatGPT](https://chatgpt.com): OpenAI's flagship assistant — the default base for writing, translation and customer replies, with the richest plugin ecosystem. - [Claude](https://claude.ai): Anthropic's model known for long-form analysis and coding; Claude Code is one of the most popular terminal agents today. - [Gemini](https://gemini.google.com): Google's multimodal assistant with a generous free tier, deeply integrated with Gmail and Docs. - [DeepSeek](https://chat.deepseek.com): One of the best Chinese models with a friendly API price — ideal for batch text work and self-built apps. For the open agent runtime, see DeepSeek Harness. - [Kimi](https://kimi.moonshot.cn): Moonshot's model with a huge context window — great at digesting contracts, reports and competitor sites. - [豆包 Doubao](https://www.doubao.com): ByteDance's AI assistant with strong Chinese-language experience, a generous free tier, and tight links to the Douyin ecosystem. - [Perplexity](https://www.perplexity.ai): AI search engine with cited, real-time answers — a magnitude faster for competitor and market research. - [NotebookLM](https://notebooklm.google.com): Google's document Q&A tool — drop in sources for summaries, answers and even AI podcasts. A due-diligence staple. - [Gamma](https://gamma.app): Turns a prompt into decks, pages and docs — pitch and product materials in minutes. - [HeyGen](https://www.heygen.com): AI avatar videos with lip-synced multilingual voice — mass-produce short videos and product intros. - [ElevenLabs](https://elevenlabs.io): The most natural AI text-to-speech today — multilingual dubbing, voice agents and audio content. - [Suno](https://suno.com): AI music generation — cheap, royalty-free BGM for social clips and brand anthems. - [Midjourney](https://www.midjourney.com): The quality ceiling for AI images — product shots, marketing assets and packaging concepts. - [Runway](https://runwayml.com): AI video generation and editing — quick ad clips and motion assets, with an API for workflows. - [可灵 Kling](https://klingai.com): Kuaishou's video model with strong Chinese prompt understanding and solid consistency. - [CapCut 剪映海外版](https://www.capcut.com): The standard editor for the TikTok ecosystem — captions, templates and AI features out of the box. - [Cursor](https://cursor.com): The AI-native IDE — completion, chat and agent mode in one. First choice for storefronts and small tools. - [Claude Code](https://www.anthropic.com/claude-code): Anthropic's terminal agent: reads repos, runs commands and calls APIs — far stronger with Agent Skills. - [Gemini CLI](https://github.com/google-gemini/gemini-cli): Google's official open-source terminal agent: Apache-2.0, built-in search and MCP, a generous free tier — the second knife beside Claude Code. - [v0](https://v0.dev): Vercel's prompt-to-UI tool for React/Tailwind — the fastest route to a landing-page prototype. - [Bolt](https://bolt.new): Prompt-to-fullstack-app in the browser with instant preview and deploy — plenty for validating ideas. - [GitHub Copilot](https://github.com/features/copilot): The veteran AI pair-programmer across all major IDEs — lowest team onboarding cost. - [n8n](https://n8n.io): Open-source workflow automation with native AI nodes; free to self-host — the first stop for repetitive flows. - [Dify](https://dify.ai): Visual AI app builder with RAG, workflows and multi-provider models — the default SME PoC base. - [Coze](https://www.coze.com): ByteDance's agent builder with a rich plugin ecosystem and knowledge bases — Chinese-friendly. - [Flowise](https://flowiseai.com): Open-source visual LLM orchestration — drag-and-drop RAG pipelines for fast prototyping. - [Zapier](https://zapier.com): The veteran no-code automation with 8,000+ app integrations — non-technical teams can wire flows. - [Make](https://www.make.com): Visual automation with a clearer canvas than Zapier and stronger branching for complex flows. - [OpenRouter](https://openrouter.ai): One API key, hundreds of models — compare, fall back and rate-limit without the plumbing. - [Ollama](https://ollama.com): The lowest bar for local open models — one command for Llama, Qwen or DeepSeek; data stays on your machine. - [Hugging Face](https://huggingface.co): The GitHub of models and datasets — find models, check leaderboards, run demos. - [Firecrawl](https://firecrawl.dev): Clean web-to-markdown/structured-data for LLMs — essential plumbing for content pipelines and RAG. - [Jungle Scout](https://www.junglescout.com): The veteran Amazon product-research suite: market size, competitor sales and keyword reverse-lookup. - [Helium 10](https://www.helium10.com): The all-in-one Amazon seller suite — keyword research, listing optimization and profit calcs. - [卖家精灵 SellerSprite](https://www.sellersprite.com): The most-used Amazon data tool among Chinese sellers, with beginner-friendly UI and docs. - [Keepa](https://keepa.com): The authoritative Amazon price-history source — check it before any pricing decision. - [CamelCamelCamel](https://camelcamelcamel.com): The free Keepa alternative for Amazon price history — enough for light research. - [Shopify](https://www.shopify.com): The world's default storefront platform — building, payments and the richest app ecosystem. - [WooCommerce](https://woocommerce.com): The free e-commerce plugin for WordPress with full data ownership — a developer favorite. - [店匠 Shoplazza](https://www.shoplazza.com): Mainstream SaaS storefront for Chinese teams — Chinese admin plus local payment rails. - [SHOPLINE](https://www.shopline.com): Storefront SaaS with strong Southeast-Asia localization — friendly for the APAC market. - [Squarespace](https://www.squarespace.com): The most design-forward site builder — a common pick for brand-sensitive DTC stores. - [店小秘](https://www.dianxiaomi.com): Cross-border ERP that starts free — multi-platform orders, purchasing, warehouse and finance. - [领星 ERP](https://www.lingxing.com): Popular ERP among Amazon sellers, well regarded for inventory and finance modules. - [芒果店长](https://www.mangoerp.com): Multi-platform listing and order management — common among volume sellers. - [通途 ERP](https://www.tongtool.com): A veteran cross-border ERP with mature listing, order and shipping-template systems. - [Stripe](https://stripe.com): The most developer-friendly global payments platform — first choice for storefront checkout and subscriptions. - [PayPal](https://www.paypal.com): The payment method Western buyers trust most — a must-have checkout option. - [Payoneer](https://www.payoneer.com): The veteran cross-border payout service — marketplace payouts, foreign bank accounts, multi-currency. - [Airwallex 空中云汇](https://www.airwallex.com): Global business accounts: multi-currency, local collection and low-cost FX — strong for B2B. - [PingPong](https://www.pingpongx.com): Cross-border collection familiar to Chinese sellers — marketplace payouts and compliant FX. - [Wise](https://wise.com): International transfers at the real exchange rate — supplier payments, payroll and multi-currency accounts. - [Buffer](https://buffer.com): Lightweight social scheduling across platforms — plenty for individuals and small teams. - [Hootsuite](https://hootsuite.com): Enterprise social management — scheduling, listening and team workflows for multi-account ops. - [Later](https://later.com): Visual scheduling with a beautiful calendar for Instagram and TikTok content. - [Publer](https://publer.io): Budget-friendly scheduling with a generous free tier and tidy multi-account management. - [新榜](https://www.newrank.cn): Chinese content-data platform — rankings and monitoring for WeChat, Douyin and Xiaohongshu. - [Ahrefs](https://ahrefs.com): The strongest backlink and keyword-research database — first pick for storefront SEO teams. - [Semrush](https://www.semrush.com): All-in-one marketing suite — SEO, ads, content and competitor traffic teardown. - [Google Search Console](https://search.google.com/search-console): Google's official webmaster tool — indexing, coverage and search performance, free and essential. - [Google Trends](https://trends.google.com): Free global search-trend insight — handy for product picks, topics and market timing. - [Screaming Frog](https://www.screamingfrog.co.uk/seo-spider/): On-site SEO crawler — dead links, redirects and duplicate titles in one pass; the free tier suffices. - [Meta Ads Manager](https://adsmanager.facebook.com): The official Facebook/Instagram ads console — the main ad battleground for Western traffic. - [Google Ads](https://ads.google.com): The search-ads foundation — the highest-intent traffic source; every storefront must learn it. - [TikTok Ads Manager](https://ads.tiktok.com): TikTok's official ad console — the battleground for short-video commerce. - [TikTok Creative Center](https://ads.tiktok.com/business/creativecenter): Free look at TikTok top ads, music and creatives — an inspiration feed for media buyers. - [Klaviyo](https://www.klaviyo.com): The e-commerce email standard — deep Shopify integration and powerful automations. - [Mailchimp](https://mailchimp.com): Entry-level email marketing with a friendly free tier — the usual starting point. - [MailerLite](https://www.mailerlite.com): The value king — near-premium features at a budget price; a creator favorite. - [Brevo](https://www.brevo.com): Email plus SMS in one platform, with solid European localization. - [beehiiv](https://www.beehiiv.com): The native newsletter platform — growth, monetization and sponsorships; a top pick for English content. - [Modash](https://modash.io): Creator database — filter YouTube, TikTok and IG influencers by reach, region and engagement. - [Heepsy](https://heepsy.com): Influencer search and outreach with fake-follower checks and campaign tracking. - [UpPromote](https://www.uppromote.com): Affiliate and creator-program app for Shopify — auto commission links and tracking. - [递四方 4PX](https://www.4px.com): Veteran cross-border logistics — express lines, parcels and overseas warehouses across major markets. - [云途物流](https://www.yunexpress.com): YunExpress specializes in stable EU/US routes — a common pick for storefront parcel shipping. - [燕文物流](https://www.yw56.com.cn): Long-standing Chinese cross-border carrier with broad coverage via economical postal routes. - [菜鸟国际](https://www.cainiao.com): Alibaba's cross-border logistics network — the default carrier for AliExpress and Taobao sellers. - [Flexport](https://www.flexport.com): Digital freight forwarder — quotes, booking and tracking online; built for B2B container shipping. - [谷仓海外仓 GOODCANG](https://www.goodcang.com): The leading China-founded overseas warehouse network across EU/US/AU/JP with mature D2C fulfillment. - [万邑通 WINIT](https://www.winit.com.cn): Overseas warehousing and supply-chain solutions — a familiar fulfillment partner for sellers. - [ShipBob](https://www.shipbob.com): US-native 3PL with deep Shopify integration — the default fulfillment for DTC brands. - [ShipMonk](https://www.shipmonk.com): US 3PL with a friendly on-ramp for small and mid-sized DTC brands. - [17TRACK](https://www.17track.net): One-stop tracking for 1,500+ carriers — the default parcel tracker for cross-border. - [AfterShip](https://www.aftership.com): E-commerce tracking suite — branded tracking pages and email notifications that lift repeat purchases. - [Ship24](https://www.ship24.com): Wide-coverage free tracking aggregator — finds even obscure carriers. - [Google Analytics 4](https://analytics.google.com): The web-analytics baseline — traffic, conversions and events; free with the biggest ecosystem. - [Microsoft Clarity](https://clarity.microsoft.com): Free heatmaps and session replays — watch how visitors actually use your site before optimizing. - [Mixpanel](https://mixpanel.com): Product analytics — funnels, retention and cohorts; standard kit for SaaS growth teams. - [Hotjar](https://www.hotjar.com): Behavior-insight suite — heatmaps, recordings and surveys for landing-page optimization. - [Similarweb](https://www.similarweb.com): Traffic intelligence on any site — competitor channel splits and industry benchmarks. - [Zendesk](https://www.zendesk.com): The enterprise ticketing benchmark — email, chat and social in one inbox. - [Intercom](https://www.intercom.com): The default support-and-messaging platform for SaaS — in-app chat, automation and AI assist. - [Crisp](https://crisp.chat): Lightweight live chat with a free tier that fits small teams; multilingual-friendly. - [Gorgias](https://www.gorgias.com): E-commerce support built on order data — Shopify sellers answer tickets at lightning speed. - [Typeform](https://www.typeform.com): Beautiful high-completion surveys — top-tier UX for research and pre-sales intake. - [VWO](https://vwo.com): A/B testing and CRO platform — let data decide your landing-page changes. - [PostHog](https://posthog.com): Open-source product analytics, A/B testing and replays — developer-friendly and self-hostable. - [Vercel](https://vercel.com): The hosting standard for frontends — push-to-deploy, the natural home of Next.js. - [Cloudflare](https://www.cloudflare.com): CDN, DNS, security and edge computing in one — speed and protection in a single step. - [Netlify](https://www.netlify.com): The veteran static hosting with built-in forms, functions and branch previews. - [Railway](https://railway.app): The smoothest backend deployment — rich templates and fast starts for personal projects. - [Render](https://render.com): Cloud app hosting — web services, databases and cron jobs managed in one place. - [GitHub](https://github.com): The de facto standard for code hosting and collaboration — the heart of open source. - [Supabase](https://supabase.com): The open-source Firebase alternative — Postgres, auth, storage and realtime in one. - [Resend](https://resend.com): Developer-friendly email API — transactional mail wired in minutes with solid deliverability. - [Namecheap](https://www.namecheap.com): Cost-effective domain registrar with free WHOIS privacy — good for bulk registration. - [Porkbun](https://porkbun.com): Well-regarded independent registrar — transparent pricing and a clean interface. - [Squarespace Domains](https://domains.squarespace.com): The successor to Google Domains — stable renewals and simple management. - [Zoho Mail](https://www.zoho.com/mail): Free business email on your own domain — branded inboxes without the headache. - [Iconify](https://iconify.design): 100+ open icon sets behind one API — grab any icon for your site in a call. - [Lucide](https://lucide.dev): Modern line icons, tree-shakeable in React and Vue. - [Font Awesome](https://fontawesome.com): The veteran icon font — the free tier covers everyday needs. - [Iconfont 阿里图标库](https://www.iconfont.cn): Alibaba's vector icon library — the fullest Chinese icon ecosystem with custom downloads. - [Unsplash](https://unsplash.com): High-quality free stock, commercially usable — first pick for landing pages and social. - [Pexels](https://www.pexels.com): Free stock photos and videos with great search — downloads without login. - [Freepik](https://www.freepik.com): Huge library of vectors and illustrations — inspiration for ads and product imagery. - [Canva](https://www.canva.com): Online design with templates, assets and AI — non-designers ship visuals anyway. - [Google Fonts](https://fonts.google.com): The open-font hub — the easiest way to ship web fonts. - [Fontshare](https://www.fontshare.com): ITF's free commercial fonts — a notch above the usual free options in design quality. - [Figma](https://www.figma.com): The collaborative design standard — UI, prototyping and design systems in one. - [Framer](https://www.framer.com): Design-meets-build: Figma-like canvas ships a real site — a landing-page superpower. - [Coolors](https://coolors.co): Color-scheme generator — a fast start for brand and page palettes. - [remove.bg](https://www.remove.bg): One-click background removal — product shots and headshots in seconds. - [AMZ123](https://www.amz123.com): The biggest Chinese Amazon-seller community — news, tools and circles in one place. - [雨果跨境](https://www.cifnews.com): Cross-border e-commerce news and events platform with daily industry updates. - [白鲸出海](https://www.baijingapp.com): Chinese media focused on app and content going-global — the mobile-exit intelligence source. - [亿恩网](https://www.ennews.com): Cross-border e-commerce media with timely policy and marketplace-rule analysis. - [Indie Hackers](https://www.indiehackers.com): The indie-maker community — real revenue numbers and growth teardowns. - [TLDR](https://tldr.tech): One daily tech digest — keep up in five minutes; the classic dev newsletter. - [The Rundown AI](https://www.therundown.ai): One of the largest AI daily newsletters — five minutes to stay current. - [EqualOcean 亿欧](https://equalocean.com): English-language China going-global research — the window for overseas readers into Chinese tech. - [Coursera](https://www.coursera.org): University-grade courses — digital marketing, business analytics and AI programs. - [Udemy](https://www.udemy.com): Practical-course marketplace — the fullest catalog for Amazon, Shopify and AI tools. - [DeepLearning.AI](https://www.deeplearning.ai): Andrew Ng's AI course platform — short, hands-on lessons; the top AI on-ramp. - [Statista](https://www.statista.com): The authoritative market-data library — industry size, consumer trends and channel splits. - [DataReportal](https://datareportal.com): Free Digital annual reports — every country's social, internet and e-commerce penetration. - [AppGrowing](https://appgrowing.cn): Ad-intelligence platform — monitor creative and strategy across global campaigns. - [Grok](https://grok.com): xAI's model with real-time X integration and a direct, opinionated style. - [Meta AI](https://www.meta.ai): Meta's free multimodal assistant, tightly woven into Instagram and WhatsApp. - [Mistral](https://mistral.ai): Europe's open-model leader — efficient and built for self-hosted enterprise use. - [Qwen Chat](https://chat.qwen.ai): Alibaba's Qwen chat with a full open-source ecosystem and balanced multilingual skills. - [智谱清言](https://chatglm.cn): Zhipu's chat product — solid Chinese understanding with mature enterprise APIs. - [文心一言](https://wenxin.baidu.com/?enter_type=yiyan_site): Baidu's ERNIE chat, tied into Baidu Search with broad Chinese-scenario coverage. - [腾讯混元](https://hunyuan.tencent.com): Tencent's Hunyuan portal, connected to the WeChat ecosystem with growing multimodal skills. - [MiniMax 海螺](https://hailuoai.com): MiniMax's chat product with natural voice and strong long-context multimodal performance. - [Grammarly](https://www.grammarly.com): The de facto standard for English proofreading — grammar, tone and clarity in one pass. - [DeepL](https://www.deepl.com): Top-tier machine translation — the first pick for trade emails, listings and contracts. - [QuillBot](https://quillbot.com): Paraphrasing and polishing: synonym swaps, tone shifts and summaries for faster English writing. - [Ideogram](https://ideogram.ai): The best AI image model for text rendering — posters, logos and captioned assets in one prompt. - [Recraft](https://www.recraft.ai): Style-controllable AI design with vector output and strong brand consistency. - [Krea](https://www.krea.ai): Realtime AI generation and upscaling — live canvas drawing and image enhancement. - [Synthesia](https://www.synthesia.io): Enterprise AI avatar video — multilingual training and marketing at scale. - [OpusClip](https://opus.pro): Turns long videos into social clips — AI picks highlights and adds captions. - [Descript](https://www.descript.com): Edit video and podcasts like a doc — text-based editing with voice synthesis. - [OpenAI Codex](https://openai.com/codex/): OpenAI's coding agent with cloud sandboxes that run and verify your code. - [Windsurf](https://windsurf.com): AI-native IDE with deep agent integration — Cascade workflows are well loved. - [Trae](https://www.trae.ai): ByteDance's AI IDE — Chinese-friendly, generous free tier, fast to adopt. - [pi](https://pi.dev): A terminal AI coding assistant with swappable model backends, Agent Skills extensions and file/browser control — a fresh alternative to Claude Code. - [Replit](https://replit.com): Cloud IDE in the browser with AI assistance from zero to deploy. - [Langflow](https://www.langflow.org): Visual LLM workflow builder — drag-and-drop agents and RAG pipelines for engineers. - [Lindy](https://www.lindy.ai): AI assistant platform — build automations in plain language, no code required. - [Gumloop](https://www.gumloop.com): Modular AI automation with prebuilt nodes — operations teams assemble business flows. - [Photoroom](https://www.photoroom.com): AI product photography — background removal and scene swaps for listing-ready images. - [Copy.ai](https://www.copy.ai): AI copywriting platform — product descriptions, ads and emails in bulk, multilingual. - [Jasper](https://www.jasper.ai): Brand-focused AI copywriting with team collaboration and brand-voice controls. - [Tidio](https://www.tidio.com): AI chatbot plus live chat in one — a common conversion booster for Shopify stores. - [Octane AI](https://octaneai.com): Shopify AI quizzes and Q&A that capture preferences and drive product recommendations. - [AdCreative.ai](https://www.adcreative.ai): AI ad creative generation — bulk multi-size assets with predictive scores for media buyers. - [Surfer SEO](https://surferseo.com): AI-driven SEO content optimization with SERP-based briefs and measurable ranking gains. - [Predis.ai](https://predis.ai): AI social content — one prompt to posts, visuals and scheduling across platforms. - [Madgicx](https://madgicx.com): AI optimization for Meta ads — audience prediction, auto-bidding and creative analytics. - [HubSpot](https://www.hubspot.com): The CRM and marketing-automation leader, with AI across content, email and forecasting. - [Frase](https://www.frase.io): AI content & SEO platform — SERP research to first draft in one workflow. - [Groq](https://groq.com): Ultra-fast inference on LPU hardware — near-zero latency for realtime apps. - [Replicate](https://replicate.com): Open models as one-line APIs — image, video and voice, billed by the second. - [Together AI](https://www.together.ai): Open-model inference and fine-tuning with strong price-performance and throughput. - [Modal](https://modal.com): Cloud serverless compute with second-scale GPU scaling — ideal for AI backends. - [One API](https://github.com/songquanpeng/one-api): Open-source API gateway panel — one key for many models with quotas and billing; self-hostable. - [New API](https://github.com/Calcium-Ion/new-api): Community fork of One API with broader model support and channel management. - [Anthropic Agent Skills](https://github.com/anthropics/skills): Anthropic's official skills repo — the de facto reference set for the SKILL.md format. - [Superpowers](https://github.com/obra/superpowers): The most influential agent-skills collection: TDD, plan-first and debugging methodology, installable. - [Awesome Claude Code](https://github.com/hesreallyhim/awesome-claude-code): The one-stop Claude Code list: workflows, hooks, slash commands and CLAUDE.md templates. - [MCP Servers](https://github.com/modelcontextprotocol/servers): Official MCP server collection — filesystem, search, database and Slack reference implementations. - [skill-creator](https://github.com/anthropics/skills/tree/main/skills/skill-creator): The official skill-for-creating-skills: capture any workflow as a standard SKILL.md. - [wshobson/agents](https://github.com/wshobson/agents): The largest subagent collection — security audit, perf analysis and architecture review roles. - [Learn Prompting](https://learnprompting.org): Free prompting academy — systematic courses from basics to advanced techniques. - [OpenAI Academy](https://academy.openai.com): OpenAI's official learning hub — free courses on prompting and AI app development. - [Google AI for Developers](https://ai.google.dev): Google's developer AI hub — Gemini API docs, tutorials and free-tier access. - [Sellenca](https://www.laojinchuhai.com/products/sellenca): Laojin's own WhatsApp AI sales copilot — trilingual chat plus CRM, built in-house and battle-tested. - [365Loopa](https://www.laojinchuhai.com/products/365loopa): Laojin's AI content engine — news generation, topic planning and growth ops in one. - [365AIOrg](https://www.laojinchuhai.com/products/365aiorg): Laojin's cross-platform agent orchestration — run agents like a team, no vendor lock-in. - [AllModelsAPI](https://www.laojinchuhai.com/products/allmodelsapi): Laojin's multi-model API gateway — one key to the major models with cost control. - [365 Ops](https://www.laojinchuhai.com/products/shopify-ai-ops): Laojin's AI ops system — VPS assets, IP health checks and subscription management (internal). - [365Skill](https://www.laojinchuhai.com/products/365skill): Laojin's open-source Agent Skills repo — SKILL.md standard with evals and safe publishing. - [形式发票生成器](https://www.laojinchuhai.com/invoice): Laojin's own proforma-invoice tool — fill, export PDF/Excel, AI auto-fill from docs. - [外贸术语词典](https://www.laojinchuhai.com/glossary): Laojin's trade glossary + calculators — FOB/CIF, volumetric weight and chargeable tons. - [OpenClaw](https://openclaw.ai): Your own personal AI assistant — runs on any OS and platform, from desktop pets to robots. One of the hottest open-source agents. - [Hermes Agent](https://hermes-agent.nousresearch.com): Nous Research's personal agent that grows with you — it adapts to your habits over time. - [PraisonAI](https://praison.ai): Hire a 24/7 AI workforce — low-code multi-agent collaboration for non-engineers. - [QwenPaw](https://qwenpaw.agentscope.io): Alibaba AgentScope's personal AI assistant — easy to install and deploy, local-first with strong Chinese support. - [Cherry Studio](https://cherryai.com): AI productivity studio for desktop — multi-model chat, knowledge bases and agent orchestration in one. - [Manus](https://manus.im): Autonomous general-purpose agent that completes tasks end-to-end — research, reports and spreadsheets. - [Devin](https://devin.ai): Cognition's AI software engineer — plans, codes, debugs and ships tasks independently. - [OpenHands](https://openhands.dev): Open-source AI software engineer — reads code, runs commands and drives the browser to ship features. - [AutoGPT](https://agpt.co): The project that kicked off autonomous agents — set a goal and it plans and executes. Now a full platform. - [Agent Zero](https://agent-zero.ai): A lightweight autonomous agent framework — plan, act and reflect loops right from the terminal. - [Open Interpreter](https://openinterpreter.com): Let AI operate your computer with natural language — a code interpreter that touches files, scripts and the browser. - [MetaGPT](https://atoms.dev): Multi-agent software company — PM, architect and engineer roles collaborate to ship projects from one prompt. - [PR Agent](https://www.pr-agent.ai): Open-source PR review agent — auto-reviews pull requests, suggests fixes and writes tests. - [CrewAI](https://crewai.com): The fastest multi-agent orchestration on-ramp — give each agent a job description and they work as a crew. - [Smolagents](https://huggingface.co/docs/smolagents): Hugging Face's minimal agent framework — code-first, runs in dozens of lines, great for learning and production. - [Letta](https://letta.com): The platform for stateful agents — persistent memory and state for AI, built for long-lived conversations (ex-MemGPT). - [AgentGPT](https://agentgpt.reworkd.ai): Autonomous agents in your browser — name one, give it a goal, watch it plan and execute. - [SuperAGI](https://superagi.com): Dev-first open-source autonomous agent framework — visual tool calls and an agent marketplace. - [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness): DeepSeek's open-source agent runtime (dsh): everything is a plugin, one npx command for the Web UI. Developer preview, MIT. - [Pi Agent](https://github.com/earendil-works/pi): Mario Zechner's minimal terminal coding harness: 4 base tools, full TypeScript extensions, skills & SDK embedding. MIT. - [OpenCode](https://github.com/anomalyco/opencode): Open multi-surface coding agent: terminal TUI + desktop + IDE, any LLM, one-click switch. MIT. - [OpenClaw](https://github.com/openclaw/openclaw): A personal AI assistant on your devices: local Gateway for WhatsApp/Telegram/Slack and more. The lobster way 🦞. - [Hermes Agent](https://github.com/NousResearch/hermes-agent): Nous Research's self-improving agent: built-in learning loop, persistent memory, any model. MIT. - [Aider](https://github.com/Aider-AI/aider): Veteran AI pair-programming agent: git-centric, every change a reviewable diff commit. Apache-2.0. - [Model Context Protocol (MCP)](https://modelcontextprotocol.io): The industry-standard protocol connecting AI to tools: a standard client-server interface for any AI client and any tool. - [LangChain](https://github.com/langchain-ai/langchain): MIT framework for agents and LLM apps: compose models, tools and retrieval. Not a model brand, and not a synonym for LangGraph. - [Agent Skills](https://agentskills.io): The SKILL.md open spec: triggerable playbooks for specialized tasks. Not the Claude Code product itself. - [OpenAI Agents SDK](https://github.com/openai/openai-agents-python): OpenAI's official Python multi-agent SDK (openai-agents): Agent + Runner, tracing and handoffs. Not ChatGPT. ## Full content index (citable) ### Sam Altman on GPT-5, Sora and the board saga URL: https://www.laojinchuhai.com/en/classics/sam-altman-lex-fridman-419 Speaker: Sam Altman × Lex Fridman | Date: 2024-03-18 Intro: OpenAI CEO Sam Altman's first long conversation after the 'coup' that briefly removed him: inside the seven-day board saga, his disagreements with Ilya and Elon, the direction of GPT-5, why Sora matters, and how he thinks about AGI and power. The timing makes it special — the world had just seen Ope ### Sam Altman on Sora, energy, and building an AI empire URL: https://www.laojinchuhai.com/en/classics/sam-altman-a16z-2025 Speaker: Sam Altman × Ben Horowitz × Erik Torenberg | Date: 2025-10-08 Intro: a16z co-founder Ben Horowitz sits down with Sam Altman for their first public conversation: why OpenAI is 'four companies in one', the worldview behind Sora, why energy is AI's ultimate constraint, and his thesis on unbounded compute demand. 49 minutes of unusually candid conversation between one of ### Sam Altman on AGI, Compute Race and Physical AI URL: https://www.laojinchuhai.com/en/classics/sam-altman-invest-like-the-best-2026 Speaker: Sam Altman × Patrick O'Shaughnessy | Date: 2026-07-28 Intro: In late July 2026, Sam Altman candidly admits OpenAI was spreading itself too thin and is now sharpening focus on critical breakthroughs. Uncapped compute demand, custom silicon (Jalapeño), safety concerns around unreleased models attempting sandbox breakouts, and why physical robotics prevents huma ### Sam Altman on building OpenAI & betting on the impossible URL: https://www.laojinchuhai.com/en/classics/sam-altman-founders-2026 Speaker: Sam Altman × David Senra | Date: 2026-08-23 Intro: In August 2026, OpenAI CEO Sam Altman talks at length with David Senra on the Founders podcast. What sets it apart is the interviewer — someone who has read 400+ biographies of history's greatest entrepreneurs and frames today's founders through history's mirror. So it's less 'OpenAI news' and more ### Demis Hassabis: We're three quarters of the way to AGI URL: https://www.laojinchuhai.com/en/classics/demis-hassabis-sequoia-2026 Speaker: Demis Hassabis × Konstantine Buhler | Date: 2026-04-29 Intro: DeepMind CEO and Nobel laureate Demis Hassabis at Sequoia AI Ascent 2026: why AGI is achievable by 2030, why drug discovery could collapse from ten years to days, and why information — not matter or energy — is the most fundamental substance in the universe. In 26 minutes, the man who made 'accelera ### Mustafa Suleyman on whether AI will save or end humanity URL: https://www.laojinchuhai.com/en/classics/mustafa-suleyman-trevor-noah Speaker: Mustafa Suleyman × Trevor Noah | Date: 2025-09-18 Intro: Mustafa Suleyman — DeepMind co-founder and now Microsoft AI CEO — may be AI's most 'complex' leader: he wrote 'The Coming Wave' warning of technological containment failure while steering Microsoft's AI product line. Trevor Noah's interview style draws out the core contradiction — 'AI's dark side vs ### Jensen Huang's vision for the future URL: https://www.laojinchuhai.com/en/classics/jensen-huang-cleo-abram Speaker: Jensen Huang × Cleo Abram | Date: 2025-01-27 Intro: Jensen Huang, NVIDIA's founder, is the biggest shovel-seller of the AI compute era. This rare interview gets him to lay out the full logic of 'accelerated computing': why Moore's law yields to parallel computing, why data centers are now 'AI factories', and why robotics and physical AI are the next ### Fei-Fei Li on spatial intelligence and large world models URL: https://www.laojinchuhai.com/en/classics/feifei-li-bloomberg-2026 Speaker: Fei-Fei Li × Emily Chang | Date: 2026-06-04 Intro: The 'Godmother of AI' Fei-Fei Li — Stanford professor, World Labs CEO, ImageNet creator — focuses on her new direction: spatial intelligence. Teaching AI not just to read text but to see the world, understand 3D space, and predict physical interactions. From 'making AI see' to 'making AI act', she e ### Dario Amodei on Claude, AGI and the future of AI & humanity URL: https://www.laojinchuhai.com/en/classics/dario-amodei-lex-fridman-452 Speaker: Dario Amodei × Lex Fridman | Date: 2024-11-11 Intro: A five-hour conversation with Anthropic CEO Dario Amodei plus segments with Amanda Askell and Chris Olah. Dario is the most systematic exponent of the scaling path: why models keep improving, why safety is an engineering discipline, and the 'compressed 21st century' vision from Machines of Loving Gr ### Elon Musk on AI, war and humanity's future URL: https://www.laojinchuhai.com/en/classics/elon-musk-lex-fridman-400 Speaker: Elon Musk × Lex Fridman | Date: 2023-11-09 Intro: The canonical Musk AI interview — his first deep public conversation after founding xAI, covering Grok, AI regulation, open vs. closed source, and his repeatedly emphasized metric: 'useful compute per watt'. He explains why 'AI is more dangerous than nukes' yet he still founded xAI, and his assessme ### Elon Musk on Grok, Optimus and AI evolution URL: https://www.laojinchuhai.com/en/classics/elon-musk-all-in-2025 Speaker: Elon Musk × Chamath, Jason, Sacks & Friedberg | Date: 2025-09-10 Intro: Musk's latest AI update on All-In (2025): Grok's synthetic data training strategy (rewriting all human knowledge with AI), Colossus 2 supercomputer cluster, the 'Grokipedia' concept, and how AI co-evolves with humans. More compact and business-focused than the Lex Fridman conversation — and a dense ### Aravind Srinivas on AI search and the future of knowledge URL: https://www.laojinchuhai.com/en/classics/aravind-srinivas-jre-2026 Speaker: Aravind Srinivas × Joe Rogan | Date: 2026-07-01 Intro: Perplexity AI CEO Aravind Srinivas in a two-and-a-half-hour deep conversation with Joe Rogan. From 'why challenge Google search' to 'how AI changes knowledge acquisition', plus his views on IPO plans, Chinese open-source models, and the AI copyright wars. The most comprehensive public expression fro ### Bret Taylor on AI agents, outcome-based pricing and the OpenAI board URL: https://www.laojinchuhai.com/en/classics/bret-taylor-stripe-2026 Speaker: Bret Taylor × John Collison | Date: 2026-03-10 Intro: Bret Taylor — Sierra CEO, OpenAI board chairman, former Salesforce co-CEO and Facebook CTO — is one of the very few standing at both the 'AI product startup' and 'AI governance' apex. This 2026 Stripe Sessions conversation covers: why AI agents aren't SaaS, why outcome-based pricing is software's th ### Andrew Ng on the rise of AI agents and agentic reasoning URL: https://www.laojinchuhai.com/en/classics/andrew-ng-agentic-reasoning Speaker: Andrew Ng(吴恩达) | Date: 2024-11-19 Intro: Andrew Ng — Coursera founder, former chief scientist at Baidu and Google Brain — is AI adoption's most patient evangelist. This keynote proposes four agentic design patterns — reflection, tool use, planning, multi-agent collaboration — often lifting performance more than a bigger model. In 27 minute ### Kai-Fu Lee on how China is shaping the future of AI URL: https://www.laojinchuhai.com/en/classics/kai-fu-lee-diamandis-2024 Speaker: Kai-Fu Lee(李开复)× Peter Diamandis | Date: 2024-12-05 Intro: Kai-Fu Lee — 01.AI CEO, Sinovation Ventures founder, former Google China president — covers the real speed of Chinese AI: the gap with the US shrinking from 2-3 years to 6-9 months, why open-source is the 'right strategic bet' for China's AI ecosystem, and 01.AI's tough pivot from chasing super-larg ### Robin Li on application-driven AI innovation URL: https://www.laojinchuhai.com/en/classics/robin-li-wgs-2025 Speaker: Robin Li(李彦宏)× Omar Sultan Al Olama | Date: 2025-02-25 Intro: Baidu founder Robin Li in an English interview at the World Governments Summit 2025 with the UAE AI minister. He systematically lays out a perspective Silicon Valley often ignores — 'Don't focus on models, focus on applications': Baidu has been application-driven since 2023, training model capabilit ### Eric Schmidt on the AI revolution: geopolitics, military & energy URL: https://www.laojinchuhai.com/en/classics/eric-schmidt-princeton-2026 Speaker: Eric Schmidt × Alan Blinder | Date: 2026-05-22 Intro: Former Google CEO and US Defense Innovation Board chair Eric Schmidt at Princeton. Possibly the world's leading voice on 'AI × geopolitics × military': the transparent battlefield in Ukraine, the real US-China AI gap, why 'traditional coding is over', and why energy grids — not chips — are AI's true ### Karpathy: Software Is Changing, Again (Software 3.0) URL: https://www.laojinchuhai.com/en/classics/karpathy-software-3 Speaker: Andrej Karpathy | Date: 2025-06-18 Intro: Karpathy — OpenAI founding member and former Tesla AI director — frames 'Software 3.0': 1.0 is code, 2.0 is neural-net weights, and 3.0 is programming LLMs in natural language. With metaphors like 'LLMs are the new OS' and 'partial-autonomy products', he lays out how software should be designed in t ### Intro to Large Language Models URL: https://www.laojinchuhai.com/en/classics/karpathy-intro-to-llms Speaker: Andrej Karpathy | Date: 2023-11-22 Intro: Karpathy's first public lecture after leaving Tesla: one hour on what LLMs are, how they're trained, and where they're going. No math required. Tens of millions of views and the source text for countless explainers. ### Let's build GPT from scratch, in code URL: https://www.laojinchuhai.com/en/classics/karpathy-lets-build-gpt Speaker: Andrej Karpathy | Date: 2023-01-17 Intro: The classic hands-on Transformer tutorial: Karpathy opens an empty file and builds a working nano-GPT in under two hours. Self-attention, multi-head attention, residual connections and LayerNorm become runnable PyTorch. The single most effective video for de-magicking LLMs. ### Deep Dive into LLMs like ChatGPT URL: https://www.laojinchuhai.com/en/classics/karpathy-deep-dive-llms Speaker: Andrej Karpathy | Date: 2025-02-05 Intro: The 2025 'full edition': over three and a half hours covering the entire pipeline behind ChatGPT — data, tokenization, pretraining, post-training, inference, tool use, hallucinations and mitigations. A full level deeper than the 2023 one-hour talk. ### Karpathy: from vibe coding to agentic engineering URL: https://www.laojinchuhai.com/en/classics/karpathy-vibe-coding-agentic-engineering Speaker: Andrej Karpathy × Stephanie Zhan | Date: 2026-04-29 Intro: Karpathy coined 'vibe coding'. In this 2026 Sequoia conversation he pushes the idea further: from casually letting AI write code to disciplined 'agentic engineering' — how to bound an agent, how to split work between human and machine, and when to trust vs. keep a human hand on the brake. ### Ilya Sutskever: An Observation on Generalization URL: https://www.laojinchuhai.com/en/classics/ilya-observation-on-generalization Speaker: Ilya Sutskever | Date: 2023-08-14 Intro: Ilya Sutskever — OpenAI co-founder and former chief scientist — rarely speaks in public. This 2023 talk distills his thinking: why next-token prediction suffices to learn the deep structure of the world, why unsupervised learning works. A source of the 'compression is intelligence' idea. ### Geoffrey Hinton: Will AI outsmart human intelligence? URL: https://www.laojinchuhai.com/en/classics/geoffrey-hinton-royal-institution-2025 Speaker: Geoffrey Hinton | Date: 2025-07-22 Intro: 2024 Nobel laureate Geoffrey Hinton at The Royal Institution. Starting from fundamental differences between biological and digital intelligence, he explains why 'AI surpassing humans' is no longer science fiction: digital intelligence can be copied losslessly with trillions of shared parameters, whi ### Yann LeCun: LLMs won't lead to AGI URL: https://www.laojinchuhai.com/en/classics/yann-lecun-kara-swisher-2024 Speaker: Yann LeCun × Kara Swisher | Date: 2024-12-22 Intro: Turing Award winner and Meta AI chief Yann LeCun in a spirited exchange with Kara Swisher. In his signature contrarian style, LeCun explains why autoregressive LLMs won't lead to AGI — 'A baby learns more by watching the world than any LLM learns from trillions of tokens'. He proposes JEPA (Joint Em ### Jeff Dean on AI's next transformations URL: https://www.laojinchuhai.com/en/classics/jeff-dean-sequoia-2025 Speaker: Jeff Dean × Konstantine Buhler | Date: 2025-05-12 Intro: Jeff Dean — Google Chief Scientist, Alphabet's top technical leader, creator of TensorFlow and TPUs — predicts: 'Junior-engineer-level AI systems will arrive within a year' — end-to-end virtual engineers that can understand requirements, write code, debug, and test. He also explains why making compu ### Richard Sutton: Father of RL thinks LLMs are a dead end URL: https://www.laojinchuhai.com/en/classics/richard-sutton-dwarkesh-2025 Speaker: Richard Sutton × Dwarkesh Patel | Date: 2025-09-26 Intro: 2024 Turing Award winner, author of 'The Bitter Lesson', father of reinforcement learning Richard Sutton delivers the most forceful critique of the LLM roadmap: 'LLMs don't satisfy the Bitter Lesson — they rely on human-curated data, not learning from their own experience.' He explains why continual ### Clem Delangue on why AI can't stay locked behind big APIs URL: https://www.laojinchuhai.com/en/classics/clem-delangue-turing-post-2026 Speaker: Clem Delangue | Date: 2026-05-01 Intro: Hugging Face CEO Clem Delangue is perhaps open-source AI's most influential evangelist. In this 2026 interview, he offers a counterintuitive thesis: 'AI builders will explode from millions to hundreds of millions — not through cheaper big-model APIs, but through open source + local deployment.' He e ### Nat Friedman & Daniel Gross on the real signals in AI investing URL: https://www.laojinchuhai.com/en/classics/nat-friedman-daniel-gross-stripe-2026 Speaker: Nat Friedman × Daniel Gross × John Collison × Patrick Collison | Date: 2026-05-19 Intro: Nat Friedman (former GitHub CEO) and Daniel Gross (Cue founder) are perhaps the sharpest AI angel investing duo today. This Stripe Sessions 2026 conversation with the Collison brothers dissects 'what AI has actually proven in production, and what it hasn't' — they're not talking investment thesis, t ### Liang Wenfeng: Inside DeepSeek — China's most radical tech idealist URL: https://www.laojinchuhai.com/en/classics/liang-wenfeng-anchorage-2024 Speaker: 梁文锋 × 暗涌Waves(于丽丽) | Date: 2024-07-17 Intro: The only in-depth text interview with DeepSeek founder Liang Wenfeng — and one of the most globally cited texts on Chinese AI. He candidly states: DeepSeek's moat isn't model parameters, it's 'an organization and culture that can innovate'; 'closed-source moats are temporary'; 'the real gap between ### Wang Xiaochuan: Toward the mathematical principles of life sciences URL: https://www.laojinchuhai.com/en/classics/wang-xiaochuan-latepost-2025 Speaker: 王小川 × 程曼祺 | Date: 2025-02-11 Intro: Baichuan Intelligence founder Wang Xiaochuan's first deep interview after pivoting to medical AI. His core proposition is striking: 'Building a doctor equals AGI' — not simple AI-assisted diagnosis, but turning medical diagnosis into a math problem where AI learns to reason like top-tier physicians. ### Kai-Fu Lee: Only big tech can chase super-large models URL: https://www.laojinchuhai.com/en/classics/kai-fu-lee-latepost-2025 Speaker: 李开复 × 程曼祺 | Date: 2025-01-14 Intro: In early 2025, Kai-Fu Lee made a decision that shook China's AI community — merging part of 01.AI's team into Alibaba. In this LatePost interview, he becomes China's first AI founder to publicly admit 'we're no longer chasing AGI': 'For startups to chase super-large models is overreaching — only big ### Yan Junjie: Don't apply mobile internet logic to LLMs URL: https://www.laojinchuhai.com/en/classics/yan-junjie-latepost-2025 Speaker: 闫俊杰 × 程曼祺 | Date: 2025-01-20 Intro: MiniMax is the most distinctive of China's 'AI Six Tigers': no open-source, no B2B, only C2C entertainment products. Founder Yan Junjie delivers a line that silenced many: 'Better models can lead to better applications, but better applications and more users won't lead to better models' — breaking t ### DeepSeek before V4: Liang Wenfeng's talent war, org philosophy and AGI obsession URL: https://www.laojinchuhai.com/en/classics/deepseek-v4-before-latepost-2026 Speaker: 晚点 LatePost(程曼祺) | Date: 2026-04-06 Intro: In April 2026, just before DeepSeek V4's release, LatePost published perhaps the deepest insider report on DeepSeek to date. Starting from three core researchers leaving after Chinese New Year, it reveals the real tensions: talent poached by ByteDance, Xiaomi, and Tencent; Liang's uniquely 'no-overt ### Sheng Ying on xAI Infra, SGLang, and Open Source URL: https://www.laojinchuhai.com/en/classics/sv101-e247-shengying-xai-sglang Speaker: 盛颖 × 硅谷101 | Date: 2026-08-04 Intro: Sheng Ying is the former head of xAI's inference team, creator of the open-source inference engine SGLang, and co-founder/CEO of RadixArk. She describes AI infrastructure as 'a romantic relationship' — product itself that demands aesthetics. This episode covers why infra is AI's romance, the birth o ### Ilya Sutskever: From the Age of Scaling to Reconstruction URL: https://www.laojinchuhai.com/en/classics/ilya-sutskever-dwarkesh-scaling-2025 Speaker: Ilya Sutskever × Dwarkesh Patel | Date: 2025-11-25 Intro: In November 2025, Ilya Sutskever told Dwarkesh Patel we are moving from the age of scaling to the age of reconstruction — on the limits of next-token prediction, what reasoning models really mean, and why AI's future is smarter, not bigger. A defining interview for understanding the 2025 paradigm sh ### The Thinking Game: DeepMind's Official Documentary URL: https://www.laojinchuhai.com/en/classics/thinking-game-deepmind-2025 Speaker: Demis Hassabis 等(纪录片) | Date: 2025-11-25 Intro: DeepMind's official documentary The Thinking Game tells the full story from AlphaGo's defeat of Lee Sedol to DeepMind's AGI quest — with rare internal footage: Hassabis's founding vision, the AlphaGo team's long nights, and how they think about artificial general intelligence. Essential viewing for ### Sam Altman at TED 2025: Agents, Superintelligence & ChatGPT URL: https://www.laojinchuhai.com/en/classics/sam-altman-ted-2025 Speaker: Sam Altman × TED | Date: 2025-04-12 Intro: At TED 2025, Sam Altman discusses how ChatGPT became an agent platform, the new AI economy, and his candid view on the superintelligence timeline. A public-facing but information-dense look at OpenAI's 2025 strategy. ### Hinton's Nobel Interview: AI's Risks and Hopes URL: https://www.laojinchuhai.com/en/classics/hinton-nobel-official-2025 Speaker: Geoffrey Hinton × Nobel Prize | Date: 2025-03-14 Intro: The official Nobel interview with Geoffrey Hinton: from the history of neural networks to his candid warnings about AI risk — why he partly regrets his work, why superintelligence may arrive within decades, and his advice to young scientists. 18 minutes of the 'Godfather of AI's' core thinking. ### Yann LeCun: Why LLMs Aren't the Path to AGI URL: https://www.laojinchuhai.com/en/classics/yann-lecun-penn-2025 Speaker: Yann LeCun × Penn Engineering | Date: 2025-04-23 Intro: At Penn in April 2025, Yann LeCun argues why pure language models can't lead to real intelligence, why world models are key, why open-source AI is necessary, and his sober take on the current AI boom. LeCun's trademark bluntness — a counterpoint every AI practitioner should hear. ### Jensen Huang × Lex Fridman: NVIDIA, the $4T Company & the AI Revolution URL: https://www.laojinchuhai.com/en/classics/jensen-huang-lex-2026 Speaker: 黄仁勋 × Lex Fridman | Date: 2026-03-23 Intro: In March 2026, Jensen Huang sat with Lex Fridman for 145 minutes on NVIDIA's journey to a $4 trillion AI infrastructure empire: why GPUs are the oil of the AI era, CUDA's moat, his compute demand thesis, and the physical AI and robotics vision. Essential for understanding the compute race. ### Patrick Collison: Is AI Breaking the Lean Startup Playbook? URL: https://www.laojinchuhai.com/en/classics/patrick-collison-yc-2026 Speaker: Patrick Collison × Y Combinator | Date: 2026-07-31 Intro: Stripe co-founder Patrick Collison talks with YC about whether AI breaks the lean startup playbook: how AI changes iteration speed, team size, and business models — and which startup principles survive the shift. ### Jeff Dean: The 1% Rule for Building in AI URL: https://www.laojinchuhai.com/en/classics/jeff-dean-yc-2026 Speaker: Jeff Dean × Y Combinator | Date: 2026-07-30 Intro: Google legend Jeff Dean shares the '1% Rule': beyond model capability, data, evals, and engineering systems decide project success. 57 minutes of hard-won engineering wisdom. ### Alexandr Wang: A Once-in-a-Civilization Opportunity URL: https://www.laojinchuhai.com/en/classics/alexandr-wang-yc-2026 Speaker: Alexandr Wang × Y Combinator | Date: 2026-07-29 Intro: Scale AI founder Alexandr Wang on why AI is a once-in-a-civilization opportunity, how data flywheels decide the model race, and the future of AI data infrastructure. ### Sam Altman: Never a Better Time to Do a Startup URL: https://www.laojinchuhai.com/en/classics/sam-altman-yc-2026 Speaker: Sam Altman × Y Combinator | Date: 2026-07-27 Intro: OpenAI CEO Sam Altman at YC: why 'there's never been a better time to do a startup', how AI agents change startup cost structures, and his blunt advice for founders. ### Jensen Huang: The Mindset That Built NVIDIA URL: https://www.laojinchuhai.com/en/classics/jensen-huang-yc-2026 Speaker: 黄仁勋 × Y Combinator | Date: 2026-07-26 Intro: Jensen Huang at YC: from dishwasher to $4T CEO — the mindset behind NVIDIA, why suffering is an advantage, how to make 10-year decisions, and his view on AI hardware's future. ### Fei-Fei Li: Solving the Hardest Problem in Robotics URL: https://www.laojinchuhai.com/en/classics/feifei-li-a16z-robotics-2026 Speaker: 李飞飞 × a16z | Date: 2026-07-28 Intro: The 'Godmother of AI' Fei-Fei Li with a16z on World Labs' spatial intelligence vision: why understanding the 3D physical world is key to AGI, how spatial intelligence teaches robots to interact, and her view on China's AI ecosystem. ### The New Rules of Enterprise Software with Steven Sinofsky URL: https://www.laojinchuhai.com/en/classics/steven-sinofsky-a16z-2026 Speaker: Steven Sinofsky × a16z | Date: 2026-07-07 Intro: Ex-Microsoft Windows president and a16z partner Steven Sinofsky on how AI rewrites enterprise software: from tools to agents, subscriptions to outcomes, and why AI-native companies will disrupt legacy SaaS. ### Ye Qiyi on Yang Zhilin, Two Generations of Chinese AI & AGI Faith URL: https://www.laojinchuhai.com/en/classics/sv101-ye-qi-yi-moonshot-2026 Speaker: 叶奇意 × 硅谷101 | Date: 2026-07-28 Intro: SV101's deep conversation with media figure Ye Qiyi: tracing Moonshot founder Yang Zhilin's path, two generations of Chinese AI talent, a decade of talent migration, and what drives this generation of AI believers. Essential for understanding China's AI ecosystem. ### Nathan Lambert on China's AI Scene: Youth, Compute Anxiety & the AGI Showroom URL: https://www.laojinchuhai.com/en/classics/sv101-nathan-lambert-2026 Speaker: Nathan Lambert × 硅谷101 | Date: 2026-07-03 Intro: SV101 interviews Nathan Lambert (ex-Hugging Face, Interconnects author) after his China trip: young researchers' energy, compute anxiety, open-source vibrancy, and the 'AGI showroom' he observed. ### Dmitri Dolgov: The Demo Is Only 1% of the Work URL: https://www.laojinchuhai.com/en/classics/dmitri-dolgov-waymo-yc-2026 Speaker: Dmitri Dolgov × Y Combinator | Date: 2026-08-03 Intro: Waymo co-CEO Dmitri Dolgov with YC: from Google X project to the world's largest autonomous driving company — why the demo is only 1% of the work, the hard part of scaling, building a safety culture, and lessons for AI systems in the real world. ### Travis Kalanick: Building a Company in Stealth URL: https://www.laojinchuhai.com/en/classics/travis-kalanick-a16z-2026 Speaker: Travis Kalanick × a16z | Date: 2026-07-22 Intro: Uber founder Travis Kalanick's 92-minute conversation with a16z: why he builds in stealth, his read on AI infrastructure opportunities, and lessons from failure, ouster, and reinvention. ### Manus's Last Interview Before the Sale: Peak Ji on the Wild 2025 URL: https://www.laojinchuhai.com/en/classics/zhangxiaojun-manus-last-interview-2025 Speaker: 季逸超(Manus 联合创始人) × 张小珺 | Date: 2025-12-30 Intro: The final interview with Manus co-founder and chief scientist Ji Yichao (Peak), recorded before Meta's full acquisition — the deal hadn't happened yet at recording time but was announced by publication. 3.5 hours covering Manus's path from 0 to $100M ARR, collective decision mistakes and reflections ### He Xiaopeng Returns: The Iron Humanoid Robot & Bigger Bets URL: https://www.laojinchuhai.com/en/classics/zhangxiaojun-he-xiaopeng-2026 Speaker: 何小鹏(小鹏汽车董事长/CEO) × 张小珺 | Date: 2026-05-28 Intro: Xpeng chairman He Xiaopeng returns: after 'swimming in a sea of blood', he bet on the Iron humanoid robot and the AI war in 2025. On Iron's birth and the accident, a CEO's mindset amid technological upheaval, the GX, and the 'no frankensteins' product philosophy. ### Yin Qi on Leading StepFun: Smart People's Temptations & Trade-offs URL: https://www.laojinchuhai.com/en/classics/zhangxiaojun-yin-qi-stepfun-2026 Speaker: 印奇(阶跃星辰董事长) × 张小珺 | Date: 2026-01-26 Intro: In January 2026, Yin Qi became chairman of LLM company StepFun. A 2-hour deep dive: the transition from AI 1.0 to 2.0, the brutal elimination race of long-horizon work, redefining StepFun, the line between smart people's temptation, technical faith and speculation, and Yao Class, startups, and super ### Li Xiang Returns: CEO as LLM, MoE, and Human Wisdom URL: https://www.laojinchuhai.com/en/classics/zhangxiaojun-li-xiang-2025 Speaker: 李想(理想汽车创始人/CEO) × 张小珺 | Date: 2025-10-30 Intro: Li Xiang's full 3-hour second interview. Zhang Xiaojun treats Li as a 'CEO LLM' — using the MoE metaphor to invoke his technical, strategic, and organizational experts. From CEO-as-LLM and Liang Wenfeng to VLA, energy, memory, human nature, intimacy, and human wisdom. A 'node-style archive of thinki ### Luo Fuli: The AI Paradigm Shift & the Agent Era URL: https://www.laojinchuhai.com/en/classics/zhangxiaojun-luo-fuli-2026 Speaker: 罗福莉(小米大模型团队负责人) × 张小珺 | Date: 2026-04-24 Intro: Luo Fuli's first long-form interview — ex-DeepSeek researcher, now head of Xiaomi's LLM team. In 2026 the paradigm shifts from the pre-training Chat era to the post-training Agent era. 3.5 hours on the shocks triggered by OpenClaw and other variables, why the agent paradigm 'depends on post-training ### MiniMax's Yan Junjie: Don't Apply Mobile-Internet Logic to LLMs URL: https://www.laojinchuhai.com/en/classics/latepost-minimax-yanjunjie-2025 Speaker: 闫俊杰(MiniMax 创始人/CEO) × 晚点 | Date: 2025-01-20 Intro: A deep interview with MiniMax founder Yan Junjie (valued at $3B+): why 'better models lead to better apps, but better apps and more users don't lead to better models', the MiniMax-01 open-source release, and the moment China's LLM startup conversation shifted from 'who raised' to 'who falls first'. ### Kai-Fu Lee: Only Big Tech Can Chase Frontier Models URL: https://www.laojinchuhai.com/en/classics/latepost-kai-fu-lee-2025 Speaker: 李开复(零一万物创始人) × 晚点 | Date: 2025-01-14 Intro: In early 2025, 01.AI formed a joint industry-model lab with Alibaba Cloud, with most training and Infra teams joining Alibaba. Kai-Fu Lee's first interview after the news: what actually changed, the 'teacher-student' model relationship, and 01.AI's pivot to smaller, faster, cheaper models and applic ### Wang Xiaochuan: AI × Medicine and the Math of Life URL: https://www.laojinchuhai.com/en/classics/latepost-wang-xiaochuan-medical-2025 Speaker: 王小川(百川智能创始人) × 晚点 | Date: 2025-02-11 Intro: Baichuan founder Wang Xiaochuan on the medical focus, the Baichuan-M1-Preview reasoning model, and his long-standing quest: 'from turning physics into math, to turning language into math, to turning life into math'. ### Yao Song: Deephi, Oriental Space & a Decade of Hard Tech URL: https://www.laojinchuhai.com/en/classics/latepost-yao-song-2026 Speaker: 姚颂(Striding AI 创始人) × 晚点 | Date: 2026-07-22 Intro: Yao Song sold Deephi for $300M at 26, founded commercial space company Oriental Space, and is now on his third startup in physical AI. Nearly 3 hours: from Tsinghua to the youthful days of Yang Zhilin and peers, to the decade hard tech went from niche to mainstream in China. ### Liblib's Chen Mian: On Surviving and Near-Death Moments URL: https://www.laojinchuhai.com/en/classics/latepost-liblib-chenmian-2026 Speaker: 陈冕(Liblib/Evoken 创始人) × 晚点 | Date: 2026-07-30 Intro: A deep interview with Evoken (Liblib/Lovart/LibTV) founder Chen Mian: an AI app company with $300M+ ARR and a $2B valuation that raised $300M, facing simultaneous controversy over originality, pricing, and technical depth. The shared condition of this generation of AI app companies: value that belon ### You Kaichao: Open-Source Infra, vLLM & Model Co-design URL: https://www.laojinchuhai.com/en/classics/zhangxiaojun-you-kaichao-infra-2026 Speaker: 游凯超 × 张小珺 | Date: 2026-07-28 Intro: A 3-hour interview with vLLM core developer You Kaichao: why 'if vLLM fails, we'll regret it for life', how open-source infra and model co-design reshape inference performance, and where Chinese open inference engines sit in global AI infrastructure. ### Ke Liyiming: Pi's Open-Source Models & the Robotics World URL: https://www.laojinchuhai.com/en/classics/zhangxiaojun-ke-liyiming-pi-2026 Speaker: 柯丽一鸣(Physical Intelligence)× 张小珺 | Date: 2026-07-16 Intro: A 4-hour interview with Physical Intelligence researcher Ke Liyiming: Pi's open-source model research path, the full 'world, genealogy, and protagonists' of robotics — from academia to industry, and what open source means for robotics. ### Yao Shunyu: Training Models at Anthropic & Gemini URL: https://www.laojinchuhai.com/en/classics/zhangxiaojun-yao-shunyu-2026 Speaker: 姚顺宇 × 张小珺 | Date: 2026-05-11 Intro: A 4-hour interview with Yao Shunyu, who trained models at both Anthropic and Gemini: first-hand comparison of the two top labs, his method for technical prediction, and why he says 'heroism is over' — AI research has entered the industrial era. ### Su Yu: Agent Tech History & the OpenClaw Moment URL: https://www.laojinchuhai.com/en/classics/zhangxiaojun-su-yu-agent-2026 Speaker: 苏煜 × 张小珺 | Date: 2026-05-01 Intro: A comprehensive interview with agent researcher Su Yu: where agent tech came from, what the OpenClaw Moment means, the erasure of boundaries (human-system, agent-agent), and the social ripple effects. ### Xie Saining's 7-Hour Marathon: World Models & Twice Rejecting Ilya URL: https://www.laojinchuhai.com/en/classics/zhangxiaojun-xie-saining-2026 Speaker: 谢赛宁 × 张小珺 | Date: 2026-03-16 Intro: A 7-hour marathon interview with ex-OpenAI researcher Xie Saining: frontier world-model research, why he twice declined Ilya Sutskever's invitations, his choice to leave Silicon Valley, and his ties to Yann LeCun and Fei-Fei Li. One of the deepest tech-life interviews of 2026. ### Zhipu CEO Zhang Peng: The First Global LLM IPO URL: https://www.laojinchuhai.com/en/classics/zhangxiaojun-zhang-peng-zhipu-2026 Speaker: 张鹏(智谱 CEO)× 张小珺 | Date: 2026-01-08 Intro: Zhipu CEO Zhang Peng's deep interview after the 'first global LLM IPO': what the listing means, how Chinese LLM companies face OpenAI, and Zhipu's tech and commercialization path. ### Wu Minghui's 19-Year Story: Enterprise Agentic Models URL: https://www.laojinchuhai.com/en/classics/zhangxiaojun-wu-minghui-2025 Speaker: 吴明辉(明略科技)× 张小珺 | Date: 2025-10-09 Intro: Minglue Tech founder Wu Minghui recounts 19 years of entrepreneurship: long ups and downs, painful pivots, enterprise Agentic Models, the numeric game of the real world, and the IPO path. A complete sample of a Chinese B2B AI company. ### Yao Shunyu (OpenAI): 6 Years of Agent Research URL: https://www.laojinchuhai.com/en/classics/zhangxiaojun-yao-shunyu-openai-2025 Speaker: 姚顺雨(OpenAI)× 张小珺 | Date: 2025-09-11 Intro: A 3-hour interview with OpenAI researcher Yao Shunyu: the full arc of 6 years of agent research, human-system relations, 'the devouring boundary' — how agents progressively take over human work — and his view of a world that is both unipolar and plural. ### Yang Zhilin Returns: K2, Agentic LLMs & the Brain in a Vat URL: https://www.laojinchuhai.com/en/classics/zhangxiaojun-yang-zhilin-2025 Speaker: 杨植麟(月之暗面 CEO)× 张小珺 | Date: 2025-08-27 Intro: Moonshot CEO Yang Zhilin's second deep conversation after a year: the K2 model's tech route, the Agentic LLM vision, the 'brain in a vat' philosophical metaphor, and his belief in 'standing at the beginning of the infinite'. ### Zhang Xiangyu: Multimodal Struggles & Two GPT-4 Moments URL: https://www.laojinchuhai.com/en/classics/zhangxiaojun-zhang-xiangyu-2025 Speaker: 张祥雨(阿里通义)× 张小珺 | Date: 2025-06-02 Intro: A deep interview with Alibaba Tongyi's multimodal lead Zhang Xiangyu: the struggle history of multimodal research — the full path from Qwen-VL to today — and his prediction of two 'GPT-4 moments' in the next two years. ### Li Xiang's First 3-Hour Interview (Full Podcast) URL: https://www.laojinchuhai.com/en/classics/zhangxiaojun-li-xiang-2025-full Speaker: 李想(理想汽车创始人)× 张小珺 | Date: 2025-01-02 Intro: Li Auto founder Li Xiang's first full 3-hour interview: a nerd, AI, family, games, and the ladder — an auto founder's view on AI, Li Auto's organizational methods, and ladder-like long-termism. ### Kimi K3 Explained: The Model That Shook Anthropic's Valuation URL: https://www.laojinchuhai.com/en/classics/latepost-kimi-k3-2026 Speaker: 晚点 × Kimi K3 详解 | Date: 2026-08-04 Intro: LatePost's deep dive into Moonshot's Kimi K3: why the 2.8T-parameter open model shook Anthropic's valuation, its architectural innovations, reasoning capabilities, and how its open-source strategy reshapes the global model landscape. ### Yao Shunyu: 300 Days at Tencent URL: https://www.laojinchuhai.com/en/classics/latepost-yao-shunyu-tencent-2026 Speaker: 姚顺雨 × 晚点 | Date: 2026-08-01 Intro: A deep interview with Yao Shunyu 300 days after joining Tencent — he trained models at Anthropic and Gemini: why he chose Tencent, what building LLMs there is like, comparisons with overseas labs, and Tencent's AI strategy. ### Momenta's Cao Xudong After IPO: AI Without an End URL: https://www.laojinchuhai.com/en/classics/latepost-cao-xudong-momenta-2026 Speaker: 曹旭东(Momenta 创始人)× 晚点 | Date: 2026-07-15 Intro: A deep re-interview with Momenta founder Cao Xudong after the IPO: the listing journey, survival rules for autonomous-driving suppliers, the 'AI without an end' vision, and Momenta's next battlefield. ### Xu Huazhe on Embodied AI Again: Don't Miss the Biggest Watermelon URL: https://www.laojinchuhai.com/en/classics/latepost-xu-huazhe-embodied-2026 Speaker: 许华哲 × 晚点 | Date: 2026-05-26 Intro: A deep interview with embodied-intelligence researcher Xu Huazhe: why he's founding again in embodied AI, the 'don't miss the biggest watermelon' bet, the tech-route debates, and the state of China's embodied startup ecosystem. ### DeepSeek V4 Explained: The Infra Whale & 1M Context URL: https://www.laojinchuhai.com/en/classics/latepost-deepseek-v4-2026 Speaker: 晚点 × DeepSeek V4 详解 | Date: 2026-04-30 Intro: LatePost's deep dive into DeepSeek V4: the Infra whale's engineering might, how 1M context became real, the extreme efficiency optimizations, and the impact of the strongest open model. ### Tang Wenbin: China's Earliest AI Founder & His Embodied Journey URL: https://www.laojinchuhai.com/en/classics/latepost-tang-wenbin-2026 Speaker: 唐文斌(原力灵机创始人)× 晚点 | Date: 2026-04-27 Intro: From Megvii to Yuanli Lingji — Tang Wenbin is one of China's earliest AI founders. A deep interview: lessons from the previous generation of AI companies, why embodied AI now, and Yuanli Lingji's tech and commercialization route. ### MuleRun's Chen Yusen: Claude Code & Disposable Software URL: https://www.laojinchuhai.com/en/classics/latepost-mulerun-chen-yusen-2026 Speaker: 陈宇森(MuleRun 创始人)× 晚点 | Date: 2026-02-12 Intro: A deep interview with MuleRun founder Chen Yusen: how Claude Code creates a new agent-authoring paradigm, the 'disposable software' future, and how AI coding reshapes the software industry. ### DP Technology: AI for Science, from Start to Now URL: https://www.laojinchuhai.com/en/classics/latepost-dp-technology-2025 Speaker: 张林峰/孙伟杰(深势科技)× 晚点 | Date: 2025-11-10 Intro: A deep interview with DP Technology founders Zhang Linfeng and Sun Weijie: the full path of AI for Science from academia to industry, AI in molecular simulation and materials, and China's global position in AI for Science. ### Dai Yusen's Mid-2025 AI Review: IMO Gold & Agent Spread URL: https://www.laojinchuhai.com/en/classics/latepost-dai-yusen-review-2025 Speaker: 戴雨森(真格基金)× 晚点 | Date: 2025-07-22 Intro: ZhenFund partner Dai Yusen's mid-2025 review with LatePost: what OpenAI's IMO gold means, how Kimi K2 turned the tables, the pace of agent adoption, and the real picture of the AI talent war. ### Tian Yuandong: An AI Researcher's Sci-Fi & 'Thought-to-Result' URL: https://www.laojinchuhai.com/en/classics/latepost-tian-yuandong-2025 Speaker: 田渊栋(Meta)× 晚点 | Date: 2025-05-17 Intro: A deep interview with Meta chief scientist Tian Yuandong: when an AI researcher writes sci-fi, his imagination of intelligence, and the judgment that 'we will eventually get thought-to-result' — BCIs, intent recognition, and AI's future forms. ### Ma Yi: DNA Is the First LLM; Intelligence Is Entropy Reduction URL: https://www.laojinchuhai.com/en/classics/latepost-ma-yi-intelligence-2025 Speaker: 马毅(香港大学)× 晚点 | Date: 2025-03-18 Intro: A deep interview with HKU professor Ma Yi: the striking claim that 'DNA is the first LLM', intelligence as entropy reduction, white-box theory and interpretable intelligence, and his critical take on current deep learning paradigms. ### Zhang Lu: How Silicon Valley Sees DeepSeek URL: https://www.laojinchuhai.com/en/classics/latepost-zhang-lu-deepseek-2025 Speaker: 张璐(Fusion Fund)× 晚点 | Date: 2025-01-29 Intro: Fusion Fund founder Zhang Lu with LatePost: how Silicon Valley investors see DeepSeek's rise, the open-vs-closed debate, agent opportunities, and an investment view 'beyond AI'. ### Chen Mian × Luo Yonghao: Let Me Make a Splash, Then Leave Quietly URL: https://www.laojinchuhai.com/en/classics/luoyonghao-chenmian-lovart-2026 Speaker: 陈冕(Liblib/Lovart 创始人) × 罗永浩 | Date: 2026-01-08 Intro: Luo Yonghao in a long conversation with Chen Mian, founder of Lovart/Liblib (Evoken): a decade collecting Big Tech jobs to 'AI is my redemption'; Liblib's rise from 0 to $300M+ ARR through near-death moments with 4,000 yuan left in the bank; the 'super frankenstein vs AI-native' logic and 'build ups ### Yan Junjie × Luo Yonghao: The Mountain Can Be Crossed URL: https://www.laojinchuhai.com/en/classics/luoyonghao-yanjunjie-minimax-2025 Speaker: 闫俊杰(MiniMax 创始人/CEO) × 罗永浩 | Date: 2025-12-10 Intro: Luo Yonghao in long conversation with MiniMax founder Yan Junjie: why one startup builds voice, video, text and music at once — true AGI must be multimodal; how Chinese companies reach global leadership with a fraction of US funding; the reflection triggered by DeepSeek's Spring Festival explosion a ### OpenClaw: The Viral AI Agent that Broke the Internet - Peter Steinberger | Lex Fridman Podcast #491 URL: https://www.laojinchuhai.com/en/classics/lex-openclaw-peter-steinberger-20260812 Speaker: channel-lex-fridman | Date: 2026-08-12 Intro: ### State of AI in 2026: LLMs, Coding, Scaling Laws, China, Agents, GPUs, AGI URL: https://www.laojinchuhai.com/en/classics/lex-state-of-ai-2026-20260812 Speaker: Lex Fridman | Date: 2026-08-12 Intro: In this special episode of the Lex Fridman Podcast (#490), the guest dives deep into the defining AI topics of 2026: the evolution of LLMs, the coding revolution, scaling law limits, GPU compute races, China's AI rise, agentic systems, and the path toward AGI. Blending technical insight with philoso ### Why AI Agents Don't Actually Understand You — Danielle Perszyk, Amazon AGI Lab URL: https://www.laojinchuhai.com/en/classics/latent-space-dani-ai-agents-20260812 Speaker: channel-latent-space | Date: 2026-08-12 Intro: ### AI Frontier Lab Strategy: A Crossover Conversation URL: https://www.laojinchuhai.com/en/classics/latent-space-frontier-lab-strategy-20260812 Speaker: Matthew Berman & swyx | Date: 2026-08-12 Intro: In this classic episode, renowned AI creators Matthew Berman and swyx engage in a deep crossover conversation about AGI and frontier lab strategy. Drawing from their unique perspectives, they dissect the competitive landscape of top AI labs, model development paths, and industry implications—offerin ### Google Part III: The AI Company. Google is amazingly well-positioned... will they win in AI? (Audio) URL: https://www.laojinchuhai.com/en/classics/channel-acquired-lCEB7xHe-20260816 Speaker: channel-acquired | Date: 2026-08-16 Intro: ### 对话王熙乔:AI时代的教育者、十年沉浮,与人类文明的下一步 URL: https://www.laojinchuhai.com/en/classics/channel-sv101-nWc1tpQn-20260819 Speaker: channel-sv101 | Date: 2026-08-19 Intro: ### 对话前DeepMind曹原:AI for Science爆发,一个新时代到来了 URL: https://www.laojinchuhai.com/en/classics/channel-sv101-H35nVgNG-20260819 Speaker: channel-sv101 | Date: 2026-08-19 Intro: ### Meta Takes on OpenAI | Apple Sues OpenAI | SK Hynix’s $26BN IPO URL: https://www.laojinchuhai.com/en/classics/channel-20vc-HoRaqNWK-20260819 Speaker: channel-20vc | Date: 2026-08-19 Intro: ### The Open-Source AI Reality | How Token Costs Will Fall 10X & Usage Will Explode 100X | Lin Qiao URL: https://www.laojinchuhai.com/en/classics/channel-20vc-PCAiqKCf-20260819 Speaker: channel-20vc | Date: 2026-08-19 Intro: ### Frontier Labs Threatened by Kimi? Should the US Ban Chinese Open-Source Models & Stripe Buys PayPal URL: https://www.laojinchuhai.com/en/classics/channel-20vc-rwGTOmdb-20260819 Speaker: channel-20vc | Date: 2026-08-19 Intro: ### Mercor Head of Product on Revenue Concentration from Frontier Labs URL: https://www.laojinchuhai.com/en/classics/channel-20vc-rlY1mHhJ-20260819 Speaker: channel-20vc | Date: 2026-08-19 Intro: ### Will Open-Source Threaten Anthropic's Business & Do Margins Matter in a World of AI | Matt Murphy URL: https://www.laojinchuhai.com/en/classics/channel-20vc-SIYWWDUK-20260819 Speaker: Matt Murphy | Date: 2026-08-19 Intro: In this episode of 20VC, Menlo Ventures partner Matt Murphy discusses whether open-source models are eroding the commercial moats of closed-source players like Anthropic, whether margins still matter in AI infrastructure, and the real trade-offs between capital efficiency and growth. Drawing on his ### Jensen's Open-Weights Letter | Google Cloud Grows 82% But The Market Tanks URL: https://www.laojinchuhai.com/en/classics/channel-20vc-0oWgE5ph-20260819 Speaker: channel-20vc | Date: 2026-08-19 Intro: ### The AI Company Simulating the Entire Economy | Simile Co-founder & CEO, Joon Sung Park URL: https://www.laojinchuhai.com/en/classics/channel-20vc-ya6D6-Si-20260819 Speaker: channel-20vc | Date: 2026-08-19 Intro: ### Arena CEO: There Will be a $100BN US Open-Source Model & Data is a Trillion Dollar Market URL: https://www.laojinchuhai.com/en/classics/channel-20vc-b_VUAev1-20260819 Speaker: channel-20vc | Date: 2026-08-19 Intro: ### Leo Aschenbrenner's Situational Awareness Blows Up | Moonshot AI Raises $3.5B at $35B URL: https://www.laojinchuhai.com/en/classics/channel-20vc-Q6kDZJ0x-20260819 Speaker: channel-20vc | Date: 2026-08-19 Intro: ### The AI Boom Will Create Enormous Roadkill: Who Wins & Loses? | David Frankel URL: https://www.laojinchuhai.com/en/classics/channel-20vc-PDaGwInq-20260819 Speaker: David Frankel | Date: 2026-08-19 Intro: In this episode of 20VC, David Frankel, Managing Partner at Founder Collective, breaks down the brutal reshuffling behind the AI boom. He argues that infrastructure providers and leading model builders may capture most of the value, while many application-layer startups risk becoming roadkill. The c ### OpenRouter CEO: Why Chinese Open Models Are Beating the US | Why Enterprises Fear OpenAI & Anthropic URL: https://www.laojinchuhai.com/en/classics/channel-20vc-K72oZolo-20260819 Speaker: channel-20vc | Date: 2026-08-19 Intro: ### How to Build a $100M Growth Engine: Lessons from Wispr Flow & Superhuman | Matt Swulinski URL: https://www.laojinchuhai.com/en/classics/channel-20vc-bm8rMM4B-20260819 Speaker: channel-20vc | Date: 2026-08-19 Intro: ### How Anthropic, Costco, and Patagonia all build incorruptible companies | Eric Ries URL: https://www.laojinchuhai.com/en/classics/channel-lenny-PoJ1vTdH-20260819 Speaker: channel-lenny | Date: 2026-08-19 Intro: ### Why the next AI boom is physical AI | Caitlin Kalinowski (ex-OpenAI, Meta, Apple) URL: https://www.laojinchuhai.com/en/classics/channel-lenny-G5WTgB87-20260819 Speaker: channel-lenny | Date: 2026-08-19 Intro: ### AI predictions: Job markets, Codex beats Claude, and the death of org charts | Dan Shipper URL: https://www.laojinchuhai.com/en/classics/channel-lenny-4D3hDmGh-20260819 Speaker: channel-lenny | Date: 2026-08-19 Intro: ### The Most Rational Take on AI You’ll Hear This Year URL: https://www.laojinchuhai.com/en/classics/channel-lenny-BD3vLtWh-20260819 Speaker: Ethan Mollick | Date: 2026-08-19 Intro: Wharton professor Ethan Mollick joins Lenny's Podcast for a grounded conversation on AI. Instead of hype or fear, he offers practical ways for individuals and organizations to experiment, deploy, and build learning loops. Drawing on his research, real-world cases, and his book Co-Intelligence, this ### Tony Fadell: How to build real taste (and why AI makes it matter more) URL: https://www.laojinchuhai.com/en/classics/channel-lenny-RJjl1Twy-20260819 Speaker: channel-lenny | Date: 2026-08-19 Intro: ### What happens after coding is solved? | Fiona Fung (Claude Code & Cowork) URL: https://www.laojinchuhai.com/en/classics/channel-lenny-Ybrl4FYM-20260819 Speaker: channel-lenny | Date: 2026-08-19 Intro: ### Why OpenAI is merging Codex and ChatGPT and the future of knowledge work | Andrew Ambrosino URL: https://www.laojinchuhai.com/en/classics/channel-lenny-P3KDebPT-20260819 Speaker: channel-lenny | Date: 2026-08-19 Intro: ### The rise of taste, human authenticity and judgment in an AI world | Adam Mosseri (Head of IG) URL: https://www.laojinchuhai.com/en/classics/channel-lenny-yQ_EWmtf-20260819 Speaker: channel-lenny | Date: 2026-08-19 Intro: ### Why the AI’s honeymoon is ending (and tech workers are feeling it) | Noam Segal URL: https://www.laojinchuhai.com/en/classics/channel-lenny-_cmpIveX-20260819 Speaker: channel-lenny | Date: 2026-08-19 Intro: ### Why Netflix is betting on systems thinkers—not specialists—in the AI era | Elizabeth Stone (CPTO) URL: https://www.laojinchuhai.com/en/classics/channel-lenny-t0GiTyz4-20260819 Speaker: channel-lenny | Date: 2026-08-19 Intro: ### Why AI Is Going Vertical (Again) URL: https://www.laojinchuhai.com/en/classics/channel-lenny-tivaWTTV-20260819 Speaker: Dianne Penn | Date: 2026-08-19 Intro: In this episode, Anthropic’s Dianne Penn joins Lenny to discuss why AI is going vertical again. She explains how the next wave of value is shifting from general-purpose assistants toward domain-specific agents embedded in real workflows. The conversation covers enterprise deployment, evaluation, rel ### The playbook for building high talent density teams | Adam Ward, Head of Talent at Cursor URL: https://www.laojinchuhai.com/en/classics/channel-lenny-zegYJ6dh-20260819 Speaker: channel-lenny | Date: 2026-08-19 Intro: ### The design process is being rewritten. | OpenAI’s head of design URL: https://www.laojinchuhai.com/en/classics/channel-lenny-BV0hy6NE-20260819 Speaker: channel-lenny | Date: 2026-08-19 Intro: ### Lighthouse or Landgrab? How to Pick Your AI Sales Strategy URL: https://www.laojinchuhai.com/en/classics/channel-a16z-aakZLqxR-20260818 Speaker: channel-a16z | Date: 2026-08-18 Intro: ### Kavak's Playbook for Rebuilding a Company Around AI URL: https://www.laojinchuhai.com/en/classics/channel-a16z-n34CIw3g-20260819 Speaker: channel-a16z | Date: 2026-08-19 Intro: ### AI Is Learning to Hack. Faster Than We Expected. URL: https://www.laojinchuhai.com/en/classics/channel-a16z-RtNrvPBk-20260819 Speaker: channel-a16z | Date: 2026-08-19 Intro: ### How Open Source Became AI's Backbone URL: https://www.laojinchuhai.com/en/classics/channel-a16z-78-6dURO-20260819 Speaker: a16z | Date: 2026-08-19 Intro: This episode explores the pivotal role of open source in AI's evolution—from core frameworks to model ecosystems. Open source lowers barriers, fuels innovation, and reshapes industry dynamics. The conversation blends historical context with current trends, revealing the underlying tensions and oppor ### How Decagon Runs 90% of Its Agents on Open-Source Models URL: https://www.laojinchuhai.com/en/classics/channel-a16z-cO1f2wOx-20260819 Speaker: Decagon | Date: 2026-08-19 Intro: Decagon, an AI company specializing in customer support automation, runs 90% of its agents on open-source models. In this interview, the team shares why they chose the open-source path, how they achieve high reliability through model routing and fine-tuning, and the practical benefits in cost, data ### “Every small business should run itself” | Lassie with a16z URL: https://www.laojinchuhai.com/en/classics/channel-a16z-Fpg_8aiB-20260819 Speaker: channel-a16z | Date: 2026-08-19 Intro: ### What Happens Once AI Can Automate AI Research? URL: https://www.laojinchuhai.com/en/classics/channel-dwarkesh-patel--RXD4bTu-20260819 Speaker: Ryan Greenblatt | Date: 2026-08-19 Intro: In this episode, Ryan Greenblatt joins Dwarkesh Patel to explore what happens when AI systems can autonomously conduct AI research. He examines recursive self-improvement, the urgency of alignment, and the near-term disruption versus long-term risk. A rational thought experiment on the eve of an int ### 8 Predictions for the Era of Continual Learning URL: https://www.laojinchuhai.com/en/classics/channel-dwarkesh-patel-iewm45at-20260819 Speaker: channel-dwarkesh-patel | Date: 2026-08-19 Intro: ### Smarter AI Models Could Drive Compute Prices 10x URL: https://www.laojinchuhai.com/en/classics/channel-dwarkesh-patel-oZBGAuAN-20260819 Speaker: Dwarkesh Patel | Date: 2026-08-19 Intro: In this interview, Dwarkesh Patel explores the striking connection between AI model intelligence and compute costs. As models become more capable, demand for computational resources grows exponentially, potentially driving prices up 10x. This trend could reshape the AI industry, affecting everyone f ### Grant Sanderson (@3Blue1Brown) – AI disproved a famous math conjecture. Now what? URL: https://www.laojinchuhai.com/en/classics/channel-dwarkesh-patel-TfyPshgM-20260819 Speaker: channel-dwarkesh-patel | Date: 2026-08-19 Intro: ### What does the next training paradigm look like? URL: https://www.laojinchuhai.com/en/classics/channel-dwarkesh-patel-20p5-kQX-20260819 Speaker: channel-dwarkesh-patel | Date: 2026-08-19 Intro: ### The data black hole at the center of AI URL: https://www.laojinchuhai.com/en/classics/channel-dwarkesh-patel-4pG3SJQP-20260819 Speaker: channel-dwarkesh-patel | Date: 2026-08-19 Intro: ### The Better AI Gets, the Smaller Its Economic Share? URL: https://www.laojinchuhai.com/en/classics/channel-dwarkesh-patel-Jj-kBHzU-20260819 Speaker: Alex Imas & Phil Trammell | Date: 2026-08-19 Intro: In this conversation, behavioral scientist Alex Imas and economist Phil Trammell explore a counterintuitive proposition: as AI capabilities improve, its share of the economy might shrink. They analyze elasticity of substitution, monopolistic trends, and how technical gains are distributed, offering ### Rebuilding AlphaGo: Self-Play, RL, and the Future of LLMs URL: https://www.laojinchuhai.com/en/classics/channel-dwarkesh-patel-X_ZVSPcZ-20260819 Speaker: Eric Jang | Date: 2026-08-19 Intro: Eric Jang dissects the technical details of rebuilding AlphaGo, revealing how self-play and reinforcement learning are reshaping AI paradigms. Drawing on his work in robotics and generative models, he offers unique insights into how these methods inform the future trajectory of large language models ### From Training to Serving: The Engineering Behind GPT, Claude, and Gemini URL: https://www.laojinchuhai.com/en/classics/channel-dwarkesh-patel-xmkSf5IS-20260819 Speaker: Reiner Pope | Date: 2026-08-19 Intro: Reiner Pope joins Dwarkesh Patel to unpack the full engineering pipeline behind frontier models like GPT, Claude, and Gemini. He offers rare insights into compute scaling, data pipelines, inference optimization, and system design—revealing the critical details that make these AI systems work in prac ### Replit's Head of AI on the Future of Software Development URL: https://www.laojinchuhai.com/en/classics/channel-stripe-26aV9GTe-20260819 Speaker: Michele Catasta | Date: 2026-08-19 Intro: In this Stripe conversation, Michele Catasta, President and Head of AI at Replit, discusses how AI is reshaping programming paradigms, developer tools, and the software industry. From copilots to intelligent agents, he shares Replit's practices in AI-native development environments and insights into ### 10 Years of Stripe France: Pivoting in the AI Era URL: https://www.laojinchuhai.com/en/classics/channel-stripe-QkigrITF-20260819 Speaker: Stripe France | Date: 2026-08-19 Intro: Marking a decade of Stripe in France, this episode reflects on how the payments giant has witnessed and driven digital transformation, focusing on how AI is reshaping business operations and models. The guest explores transition paths from legacy enterprises to tech startups, and the critical role o ### Manus AI Co-founder Tao Zhang: Building the Future of Autonomous AI Agents URL: https://www.laojinchuhai.com/en/classics/channel-stripe-dTyL3T3_-20260819 Speaker: Tao Zhang | Date: 2026-08-19 Intro: In this conversation, Tao Zhang, co-founder and CPO of Manus AI, shares insights on building one of the most talked-about AI agent products. He discusses the leap from general models to practical tools, key product design decisions, and how AI agents are reshaping human-AI collaboration. A must-watc ### Exo: Let Agents See Their Own Code and Logs URL: https://www.laojinchuhai.com/en/classics/channel-latent-space-5lFD-34d-20260819 Speaker: Alex Krentsel | Date: 2026-08-19 Intro: Alex Krentsel from UC Berkeley and Google Research joins Latent Space to discuss Exo: the idea that AI agent harnesses should expose their own code, logs, and tool definitions to the agent itself. This transparency enables self-debugging and continuous improvement, offering a fresh perspective on au ### They Thought the Model Was Broken — Chai Discovery's Breakthrough URL: https://www.laojinchuhai.com/en/classics/channel-latent-space-Qp5xklyJ-20260819 Speaker: Matt McPartlon & Neil Patil | Date: 2026-08-19 Intro: Matt McPartlon and Neil Patil of Chai Discovery share how a seemingly 'broken' model unexpectedly became a breakthrough. From anomalous experimental results to re-examining training objectives and data assumptions, they expose common cognitive traps in AI research and show how to identify real scien ### Next 100x in AI: Inference, Networking, & Self-Optimizing Models URL: https://www.laojinchuhai.com/en/classics/channel-latent-space-7PSXtru6-20260819 Speaker: Philip Kiely & Ali Taha | Date: 2026-08-19 Intro: In this episode, Baseten's Philip Kiely and Ali Taha dive into the next decade of AI infrastructure. They argue that inference efficiency, networking, and self-optimizing models will be the key engines driving 100x growth in AI. From GPU cluster scheduling to model self-tuning, this conversation off ### OpenAI's Vision for the AI Super App URL: https://www.laojinchuhai.com/en/classics/channel-latent-space-gKhW6vL4-20260819 Speaker: Akshay Nathan | Date: 2026-08-19 Intro: In this episode of Latent Space, OpenAI's Akshay Nathan shares how ChatGPT is evolving from a chatbot into an AI super app. He discusses OpenAI's strategic thinking around model capabilities, developer platforms, and consumer experiences, revealing how future AI applications will reshape human-compu ### The AI Frontier: From Open Weights to Open Research URL: https://www.laojinchuhai.com/en/classics/channel-latent-space-9_0hs2sx-20260819 Speaker: Eiso Kant | Date: 2026-08-19 Intro: In this episode, Eiso Kant, co-founder of Poolside AI, discusses the evolution from open weights to open research in AI. Drawing on his deep experience in developer tools and AI infrastructure, he unpacks the tensions between open-source models, research transparency, and industry deployment, offeri ### Causal Models Need Causal Data: Xaira's X-Cell with Bo Wang & Ci Chu URL: https://www.laojinchuhai.com/en/classics/channel-latent-space-2AdS-2uu-20260819 Speaker: Bo Wang & Ci Chu | Date: 2026-08-19 Intro: In this Latent Space interview, Bo Wang and Ci Chu from Xaira Therapeutics present X-Cell, a foundation model for cellular biology. They argue that causal models require causal data — not just vast observational datasets — and show how designed perturbation experiments can yield truly causal signals ### RL with Verifiable Rewards, but the Verifier is a Lab: Lila Sciences URL: https://www.laojinchuhai.com/en/classics/channel-latent-space-2wIxPWK6-20260819 Speaker: channel-latent-space | Date: 2026-08-19 Intro: This episode dives into Lila Sciences' groundbreaking framework that uses laboratory experiments as verifiable rewards in reinforcement learning. Unlike traditional RL relying on math or code verification, Lila integrates real-world experiments into the loop, automating scientific discovery. The gue ### The AI Memory Problem: Why Long Context Isn't Enough URL: https://www.laojinchuhai.com/en/classics/channel-latent-space-jhpmMTus-20260819 Speaker: Dan Biderman | Date: 2026-08-19 Intro: Dan Biderman, co-founder and CEO of Engram, argues that long context windows don't truly solve AI's memory problem, instead introducing high computational costs and retrieval challenges. Drawing on neuroscience, he proposes that AI needs hierarchical integration and dynamic management similar to hum ### The Future of AI Infra: From Kubernetes to Agent Sandboxes URL: https://www.laojinchuhai.com/en/classics/channel-latent-space-UwxxlTNP-20260819 Speaker: Akshat Bubna | Date: 2026-08-19 Intro: Akshat Bubna, CTO of Modal, joins Latent Space to explore the evolution of AI infrastructure, arguing that traditional Kubernetes no longer fits AI workloads and envisioning agent sandboxes as the next-generation runtime. Drawing on Modal's engineering practice, he dissects GPU scheduling, elastic s ### The Cutting Edge of Diffusion: Drug Discovery Over Image Generation URL: https://www.laojinchuhai.com/en/classics/channel-latent-space-YQWXxnkK-20260819 Speaker: channel-latent-space | Date: 2026-08-19 Intro: This episode explores how diffusion models are making their biggest leaps in drug discovery, not image generation. The guest argues that molecular design and protein structure prediction represent the true frontier of generative AI, reshaping pharma and attracting top talent and compute. ### The Blueprint for Autonomous Work Agents | Gavriel Cohen, NanoClaw URL: https://www.laojinchuhai.com/en/classics/channel-latent-space-hLUGXO5D-20260819 Speaker: Gavriel Cohen | Date: 2026-08-19 Intro: In this interview, Gavriel Cohen, founder of NanoClaw, breaks down the blueprint for autonomous work agents. He explains core modules like task decomposition, tool use, and feedback loops, and shares hard-won lessons from real deployments—a must-watch for AI engineers and product leaders. ### OpenAI Research Chief on AGI, o1, Evals, and Scaling Laws URL: https://www.laojinchuhai.com/en/classics/channel-latent-space-fpAthTth-20260819 Speaker: Mark Chen | Date: 2026-08-19 Intro: In this special Latent Space episode, OpenAI's Chief Research Officer Mark Chen joins the hosts for a deep conversation over cooking. He reflects on the journey from GPT-3 to o1, discusses AGI timelines, the evolving role of evals, and the future of scaling laws. A must-watch for anyone tracking AI ### The Agent Cloud: Databricks' Bet on the Future of AI URL: https://www.laojinchuhai.com/en/classics/channel-latent-space-Yp_u1Npb-20260819 Speaker: Matei Zaharia and Reynold Xin | Date: 2026-08-19 Intro: In this episode, Databricks co-founders Matei Zaharia and Reynold Xin dive deep into the Agent Cloud, a platform unifying data, models, and intelligent agents. They discuss how the Lakehouse architecture powers AI agents and what enterprises should watch for when building intelligent applications. A ### Why I Put $35 Million Into Anthropic URL: https://www.laojinchuhai.com/en/classics/channel-tim-ferriss-xmohy_z0-20260819 Speaker: Guy Oseary | Date: 2026-08-19 Intro: Guy Oseary, legendary manager for U2 and Madonna, turned tech investor, invested $35 million in Anthropic. In this conversation, he explains why he bet on AI, why Anthropic stood out, and how non-technical investors can navigate frontier tech. His insights offer a rare perspective for founders and i ### Tim Ferriss: The Random Show — Mortality, AI, Supplements & Rock Climbing URL: https://www.laojinchuhai.com/en/classics/channel-tim-ferriss-JT7QpL4X-20260819 Speaker: Tim Ferriss | Date: 2026-08-19 Intro: In this classic episode of The Random Show, Tim Ferriss engages in an eclectic conversation covering mortality, AI, supplements, and rock climbing. Known for The 4-Hour Workweek, Tim connects seemingly unrelated topics through his signature cross-disciplinary lens, offering insights on living with p ### The Godfather of AI's Scary Thought Experiment URL: https://www.laojinchuhai.com/en/classics/channel-tim-ferriss-zvHr1yBm-20260819 Speaker: Geoffrey Hinton | Date: 2026-08-19 Intro: In this revealing interview, AI godfather Geoffrey Hinton shares his startling thought experiment about the future of artificial intelligence. He explores how AI might surpass human intelligence, leading to unforeseen consequences. This conversation offers profound insights into the frontiers of AI ### Do AI Founders Think They're Building God? URL: https://www.laojinchuhai.com/en/classics/channel-tim-ferriss-eRO1w9TS-20260819 Speaker: channel-tim-ferriss | Date: 2026-08-19 Intro: ### Chip design from the bottom up – Reiner Pope URL: https://www.laojinchuhai.com/en/classics/channel-dwarkesh-patel-oIk3R-sM-20260820 Speaker: channel-dwarkesh-patel | Date: 2026-08-20 Intro: ### Stripe's $8B OpenRouter Bet | Anthropic's First Profit & The Math Behind Reaching $600B in Revenue? URL: https://www.laojinchuhai.com/en/classics/channel-20vc-y_3EjW0d-20260820 Speaker: channel-20vc | Date: 2026-08-20 Intro: ### Uber's Untold Stories: Travis, China & Self-Driving URL: https://www.laojinchuhai.com/en/classics/channel-20vc-sCa1MWB9-20260820 Speaker: Andrew Macdonald | Date: 2026-08-20 Intro: Former Uber President Andrew Macdonald reveals untold stories inside the ride-hailing giant—from Travis Kalanick's aggressive leadership, the fierce battle in China, to the high-stakes bet on self-driving cars. He reflects on how Uber balanced speed and risk during global expansion, examining the fi ### Q&A with Tim — The Art of Male Friendship, Reinvention in The Age of AI, & More URL: https://www.laojinchuhai.com/en/classics/channel-tim-ferriss-NRjgAC-E-20260820 Speaker: Tim Ferriss | Date: 2026-08-20 Intro: In this Q&A, Tim Ferriss tackles identity anxiety and relational challenges in the AI era, sharing deep insights into male friendship, practical methods for continuous reinvention, and how to stay actionable amid uncertainty. Blending philosophy with actionable advice, it’s a must-watch for anyone n ### Madonna Does Not Want Her Music Trained On By AI URL: https://www.laojinchuhai.com/en/classics/channel-tim-ferriss-1LKRoPSB-20260820 Speaker: channel-tim-ferriss | Date: 2026-08-20 Intro: ### From Prediction to Simulation: Joon Sung Park on Teaching AI to Shape the Future URL: https://www.laojinchuhai.com/en/classics/channel-latent-space-KpOW9Pk4-20260821 Speaker: Joon Sung Park | Date: 2026-08-21 Intro: In a deep-dive Latent Space conversation, Simile AI founder Joon Sung Park shares insights on moving from language model prediction to world simulation. Drawing on his research at Stanford and Google, he explores how AI can not only answer questions but actively construct future scenarios, giving sy ### Tim Ferriss: I Asked AI What to Do With the Next 5 Years of My Life URL: https://www.laojinchuhai.com/en/classics/channel-tim-ferriss-Rpo5VQon-20260821 Speaker: Tim Ferriss | Date: 2026-08-21 Intro: Tim Ferriss, author of The 4-Hour Workweek, asks AI for life advice on the next five years. Drawing on his experience in tech, investing, and mental health, he reflects on how AI's answers clash with human flaws, goal-setting, and life meaning. It's both a test of machine wisdom and a deep dialogue ### From Losing Everything to a $4 Billion Comeback — Guy Oseary URL: https://www.laojinchuhai.com/en/classics/channel-tim-ferriss-4eSa9nlw-20260821 Speaker: channel-tim-ferriss | Date: 2026-08-21 Intro: ### The AI Bubble WILL Burst | Should we be fearful of Chinese Open-Source | Jerry Murdock URL: https://www.laojinchuhai.com/en/classics/channel-20vc-R1336Jyb-20260822 Speaker: channel-20vc | Date: 2026-08-22 Intro: ### Google Part II: Alphabet (Audio) URL: https://www.laojinchuhai.com/en/classics/channel-acquired-QhAftC_z-20260822 Speaker: channel-acquired | Date: 2026-08-22 Intro: ### Tokens Are the New Dollars: Stripe Executives on the Future of Payments URL: https://www.laojinchuhai.com/en/classics/channel-a16z-P5iICDVn-20260824 Speaker: Will Gaybrick & David George | Date: 2026-08-24 Intro: In this a16z conversation, Stripe CPO Will Gaybrick and a16z partner David George explore how token economies are reshaping payments and financial infrastructure. They discuss real-world stablecoin use cases, the speed and cost advantages of on-chain payments, and the path toward crypto becoming a m ### Two AI Labs Will Control Most of the World's Workforce URL: https://www.laojinchuhai.com/en/classics/channel-dwarkesh-patel-aV26V1Uv-20260825 Speaker: Dylan Patel | Date: 2026-08-25 Intro: In this interview, semiconductor analyst Dylan Patel predicts that a handful of AI labs will control most of the world's workforce through intelligent agents. He dissects the relationship between compute, model scale, and labor displacement, framing it as both a productivity revolution and a concent ### The Full AI Enterprise Sales Cycle, Step by Step URL: https://www.laojinchuhai.com/en/classics/channel-lenny-YS9In813-20260825 Speaker: Jen Abel | Date: 2026-08-25 Intro: In this in-depth interview, sales expert Jen Abel breaks down the enterprise AI sales cycle phase by phase. From lead generation and tailored demos to procurement compliance and contract negotiation, she shares actionable strategies for every stage. Startups and established companies alike will gain ### ⏭️ Forward Deployed: Voice AI on what works in 2026 URL: https://www.laojinchuhai.com/en/classics/channel-latent-space-MwNvowwc-20260825 Speaker: channel-latent-space | Date: 2026-08-25 Intro: ### DHH: Future of Programming, AI, Agentic Engineering, Vibe Coding & Linux | Lex Fridman Podcast #501 URL: https://www.laojinchuhai.com/en/classics/channel-lex-fridman-NYFGCESm-20260826 Speaker: channel-lex-fridman | Date: 2026-08-26 Intro: ### The State of AI: Models, Moats, and the Consumer Renaissance URL: https://www.laojinchuhai.com/en/classics/channel-a16z-zEZ0rQ8E-20260826 Speaker: a16z (Andreessen Horowitz) | Date: 2026-08-26 Intro: In this episode from a16z, we explore the evolution of AI models, the building of competitive moats, and the new consumer renaissance. Our guests analyze the current landscape of large language models, discuss barriers around data, compute, and ecosystems, and envision how generative AI will transfo ### How AI Changes the Economics of Innovation URL: https://www.laojinchuhai.com/en/classics/channel-a16z-GHPB1Mwl-20260826 Speaker: a16z Podcast Host | Date: 2026-08-26 Intro: In this episode from a16z, the discussion explores how AI is reshaping the cost structure, risk profile, and value capture of innovation. From software to biotech, the podcast reveals how AI shifts innovation from scarce-resource-driven to experimentation-driven, offering a powerful framework for fo ### AI Weather Prediction: Scientists Said Impossible, One Try Succeeded URL: https://www.laojinchuhai.com/en/classics/channel-latent-space-79mIutht-20260826 Speaker: Anima Anandkumar | Date: 2026-08-26 Intro: Caltech's Anima Anandkumar shares how she and her team broke traditional limits of weather forecasting with AI, succeeding on the first try despite skeptics' doubts. The conversation explores AI's potential in atmospheric science, learning physics from data, and the surprising value of interdiscipli ### How Cursor Built One of AI's Fastest-Growing Companies URL: https://www.laojinchuhai.com/en/classics/channel-a16z-GHrnbvkV-20260828 Speaker: Michael Truell | Date: 2026-08-28 Intro: In this a16z conversation, Cursor shares how the AI-native IDE became one of the fastest-growing AI companies. From product-market fit and developer experience to growth loops, the discussion unpacks Cursor's technical bets, team culture, and vision for AI-powered software development—essential view ### NVIDIA's AI Investment Spree: Acquiring Poolside, Backing Mercor & Perplexity, and Anthropic's $30T Assumption URL: https://www.laojinchuhai.com/en/classics/channel-20vc-j_JlQm8D-20260828 Speaker: channel-20vc | Date: 2026-08-28 Intro: This episode dives into NVIDIA's recent flurry of AI investments, including the acquisition of coding agent startup Poolside and investments in Mercor and Perplexity. It also examines Anthropic's bold $30 trillion market assumption, revealing the strategic moves and capital logic shaping the AGI rac ### Why Top Founders Are Racing Into AI Infrastructure URL: https://www.laojinchuhai.com/en/classics/channel-a16z-Zx1Ec8LW-20260829 Speaker: a16z | Date: 2026-08-29 Intro: In this episode from a16z, we delve into the booming AI infrastructure sector and explore why top founders are racing to invest heavily in this space. From skyrocketing compute demands to massive data center construction, AI infrastructure is increasingly viewed as the next trillion-dollar market op ### Should American Enterprises Work With Open-Source Chinese Models? | Only 10% of Neo-labs survive URL: https://www.laojinchuhai.com/en/classics/channel-20vc-h9VNB9TA-20260829 Speaker: channel-20vc | Date: 2026-08-29 Intro: ### AI's Third Era: The Rise of Persistent AI Coworkers URL: https://www.laojinchuhai.com/en/classics/channel-lenny-zMvBMfj4-20260830 Speaker: Tara Seshan | Date: 2026-08-30 Intro: Tara Seshan, OpenAI's product lead, unveils AI's third era—moving from conversational tools to persistent AI coworkers. She explains how AI evolves from ad-hoc interactions into long-term agents embedded in workflows, transforming collaboration and productivity. A forward-looking conversation essent ### Why AI Demand Is Outrunning Compute Supply URL: https://www.laojinchuhai.com/en/classics/channel-a16z-FGC4ofTc-20260901 Speaker: a16z 嘉宾 | Date: 2026-09-01 Intro: In this a16z deep dive, the guest analyzes the root causes of today's AI compute shortage, noting that explosive demand from model training and inference is rapidly consuming global compute resources. The show explores chip supply chains, data center expansion bottlenecks, and strategic choices for ### a16z's $1.1B Machine Age Fund: A Blueprint for the Future URL: https://www.laojinchuhai.com/en/classics/channel-a16z-1bmsSH9d-20260901 Speaker: a16z Partners | Date: 2026-09-01 Intro: In this classic replay, a16z partners break down their new $1.1 billion Machine Age Fund, focusing on how AI, robotics, and automation are reshaping industries. From investment thesis to sector selection and long-term vision, the conversation reveals how this top VC views the disruptive opportunitie ### The OpenAI/Hugging Face Attack, Clearly Explained URL: https://www.laojinchuhai.com/en/classics/channel-dwarkesh-patel-u15N3l4R-20260901 Speaker: Dwarkesh Patel | Date: 2026-09-01 Intro: As AI models and open-source communities grow rapidly, security threats demand attention. Dwarkesh Patel breaks down the recent attacks on OpenAI and Hugging Face with clear logic—from attack methods and defense gaps to ecosystem impact, revealing the fragility of AI infrastructure. A must-watch for ### ClickHouse CEO: AI Margins Need to Improve | Revenue Concentration Should Be a Concern URL: https://www.laojinchuhai.com/en/classics/channel-20vc-Wna2Ds4d-20260901 Speaker: ClickHouse CEO | Date: 2026-09-01 Intro: In this classic replay, ClickHouse's CEO tackles two major concerns amid the AI boom: current AI margins are far from healthy, and industry revenue is heavily concentrated among a few giants. Drawing on hands-on database experience, he explores how companies can improve gross margins through technic ### AI Can Solve Math. Can It Create Something New? URL: https://www.laojinchuhai.com/en/classics/channel-a16z-tQI35CSN-20260901 Speaker: a16z | Date: 2026-09-01 Intro: In this a16z episode, the discussion centers on AI's breakthroughs in mathematics and a deeper question: can AI truly create? Starting from mathematical proofs, the show explores AI's strengths in pattern recognition and logical reasoning, while reflecting on its potential to generate new concepts a ### The OpenAI/Hugging Face Story: An Investigator's Perspective URL: https://www.laojinchuhai.com/en/classics/channel-dwarkesh-patel-X50zezLF-20260901 Speaker: Ajeya Cotra | Date: 2026-09-01 Intro: Ajeya Cotra, a researcher focused on AI safety and governance, offers a deep dive into the trajectories and controversies of OpenAI and Hugging Face. With an investigator's rigor, she uncovers key junctures in their technical paths, mission divergences, and power dynamics, providing rare historical ### OpenAI's New AI Chip Changes Everything — Sean Lie, Cerebras CTO URL: https://www.laojinchuhai.com/en/classics/channel-latent-space-3uSI8q_R-20260902 Speaker: Sean Lie | Date: 2026-09-02 Intro: As compute power defines AI's ceiling, OpenAI's custom chip efforts spark debate. Cerebras co-founder and CTO Sean Lie joins Latent Space to decode chip architecture shifts, how wafer-scale technology breaks GPU bottlenecks, and the impact of custom silicon on training and inference. A deep dive int ### Why AI Agents Could Finally Reinvent the Credit Card URL: https://www.laojinchuhai.com/en/classics/channel-a16z-J3pegsM5-20260903 Speaker: a16z Crypto Team | Date: 2026-09-03 Intro: In this a16z conversation, experts explore how AI agents are poised to overhaul the legacy credit card infrastructure. From automated smart-contract settlements to dynamic personalized pricing, they break down inefficiencies in traditional payments and argue that AI will turn cards from passive tool ### NVIDIA Crushes Q4, OpenAI Cuts Off Cursor, Instinct Hits $2.5B Valuation URL: https://www.laojinchuhai.com/en/classics/channel-20vc-8skbt979-20260903 Speaker: channel-20vc | Date: 2026-09-03 Intro: This episode dives into three major AI headlines: NVIDIA's blowout quarter reaffirms surging demand for AI compute; OpenAI cuts ties with Cursor, exposing rising tensions between model giants and app-layer startups; and Instinct's $2.5B valuation signals intensifying competition in AI coding tools. ### Transformers Can't Think In Physics: Anima Anandkumar on Accelerated Understanding URL: https://www.laojinchuhai.com/en/classics/channel-latent-space-KS_IpnX7-20260904 Speaker: Anima Anandkumar & Benedikt Jenik | Date: 2026-09-04 Intro: In this episode, Caltech professor Anima Anandkumar and researcher Benedikt Jenik dive into the gap between large language models and physical world modeling. They argue that current transformers excel at symbolic reasoning but lack an intrinsic grasp of causality, time, and space continuity. The co ### Claude Code Skills workflow: turn team process into SKILL.md URL: https://www.laojinchuhai.com/en/tutorials/claude-code-skills-workflow ## What Skills are Agent Skills are SKILL.md procedural packages. Claude Code auto-triggers them by description. ## Description is 70% Trigger wording matters more than body length. Read it by hand after writing. > Official source: Claude Code Skills docs. Hub: /en/claude-code. ### Claude Code vs open alternatives: commercial or transparent URL: https://www.laojinchuhai.com/en/tutorials/claude-code-vs-open-source ## Two routes Claude Code is the commercial benchmark; OpenCode/Pi/Aider offer transparency and embeddability. > Based on official docs. ### Aider Quickstart: git-diff pair programming URL: https://www.laojinchuhai.com/en/tutorials/aider-quickstart ## Install ```bash python -m pip install aider-install aider-install ``` ## Run ```bash cd /to/your/project aider --model deepseek --api-key deepseek= ``` > Official source: Aider docs. Hub: /en/aider. ### Aider vs terminal agents: git flow vs multi-surface vs minimal URL: https://www.laojinchuhai.com/en/tutorials/aider-vs-terminal-agents ## Positioning Aider is git-centric; Pi for embedding; OpenCode for migration; Claude Code commercial. > Based on official docs. ### MCP intro: client-server and the three primitives URL: https://www.laojinchuhai.com/en/tutorials/mcp-intro-and-architecture ## Core model MCP defines a standard interface between clients (e.g. Claude Code) and servers. ## Three primitives Tools, Resources, Prompts. > Official source: MCP spec. Hub: /en/mcp. ### MCP in practice: one inquiry tool with list/call shape URL: https://www.laojinchuhai.com/en/tutorials/mcp-build-a-server ## Same task: one MCP tool, not a fictional production server The repo ships `examples/inquiry-routing/mcp/tool.json` and `handler.mjs`. Tool name `route_synthetic_inquiry`; `inputSchema` has only `inquiry`. `listTools` returns that one tool; `callTool` uses the same `routeInquiry` policy. This is the MCP tool data shape. It is **not** a stdio server registered in a client, and no live MCP SDK `tools/call` frame was sent. See [MCP tools](https://modelcontextprotocol.io/specification/2025-06-18/server/tools) for name, description and inputSchema. Writes still need a human. This tool sets `readOnlyHint` and always `sendAllowed: false`. ```bash node --test examples/inquiry-routing/adapters.test.mjs ``` All 12 `structuredContent` values must equal `expected-output.json`. Unknown names return `isError`. Example-domain checks are not redaction. A real transport, auth and client registration needs a separate authorized integration. Same-task Skill and SDK: [Agent Skills tutorial](/en/tutorials/agent-skills-quickstart), [Agents SDK tutorial](/en/tutorials/openai-agents-sdk-quickstart). ### OpenCode Quickstart: the open multi-surface coding agent URL: https://www.laojinchuhai.com/en/tutorials/opencode-quickstart ## Why OpenCode OpenCode is rare among open coding agents for near-commercial polish: terminal TUI, desktop and IDE across any LLM. ## Install ```bash curl -fsSL https://opencode.ai/install | bash ``` ## Connect a model Use `/connect` or env vars for Claude, GPT, DeepSeek or Ollama. ## Run a task Run `opencode` in your repo and assign tasks in the TUI. > Official source: OpenCode docs. Hub: /en/opencode. ### OpenCode vs Pi vs Claude Code: multi-surface vs minimal vs commercial URL: https://www.laojinchuhai.com/en/tutorials/opencode-vs-pi-vs-claude-code ## Three routes OpenCode: open multi-surface, good UX. Pi: minimal + SDK embedding. Claude Code: managed but closed. > Based on official docs. ### OpenClaw Quickstart: put a personal assistant on your devices URL: https://www.laojinchuhai.com/en/tutorials/openclaw-quickstart ## What it is OpenClaw is a personal assistant on your devices, connecting channels via a local Gateway. ## Three steps ```bash curl -fsSL https://openclaw.ai/install.sh | bash openclaw onboard --install-daemon openclaw gateway status openclaw dashboard ``` > Official source: OpenClaw docs. Hub: /en/openclaw. ### OpenClaw Gateway & channels: Telegram/WhatsApp in one step URL: https://www.laojinchuhai.com/en/tutorials/openclaw-gateway-channels ## The Gateway The local control plane for sessions, tools, events and channel connections. ## Security Approve DM pairings; sandbox before exposing the gateway. > Official source: OpenClaw docs. ### Hermes Agent Quickstart: a memory-driven self-improving agent URL: https://www.laojinchuhai.com/en/tutorials/hermes-agent-quickstart ## What it is Hermes is an autonomous agent with a learning loop: skills from experience, self-improvement, cross-session memory. ## Install ```bash curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash ``` ## Run ```bash hermes model hermes ``` > Official source: Hermes docs. Hub: /en/hermes-agent. ### Hermes learning loop: why it knows you better over time URL: https://www.laojinchuhai.com/en/tutorials/hermes-agent-learning-loop ## The closed loop Auto-created skills, self-improvement, memory nudges, cross-session recall with Honcho modeling. > Official source: Hermes README. ### Google Gemini API Quickstart: From AI Studio to Your First Request URL: https://www.laojinchuhai.com/en/tutorials/google-gemini-api-quickstart ## What this tutorial is for Google's Gemini API quickstart is the right first stop for developers new to Gemini. The useful learning order is not to study every model first. Close one small loop: obtain a key, read it from an environment variable, make one request, and inspect the response. ## Step 1: Create a key in AI Studio Create a key in Google AI Studio and store it in an environment variable such as `GEMINI_API_KEY`. Never put it in browser code, commit it to Git, or include it in screenshots. A browser app should call your backend; the backend owns the secret. ## Step 2: Validate the smallest request Whether you use JavaScript, Python, or REST, the first request should do one thing: ask a short question and print the text response. Do not add RAG, tool calls, streaming, or a complex system prompt until the basic path works. ```ts import { GoogleGenAI } from "@google/genai"; const ai = new GoogleGenAI({ apiKey: process.env.GEMINI_API_KEY }); const response = await ai.models.generateContent({ model: "gemini-2.5-flash", contents: "Explain cross-border commerce in one sentence.", }); console.log(response.text); ``` Model names, SDK syntax, and regional availability change. Treat the snippet as a learning shape and use Google's current documentation before production deployment. ## Step 3: Move from demo to production Add input and rate limits, request IDs, latency and error logging, timeout/retry handling, and privacy and safety checks. Never treat model output as a source of truth for pricing, compliance, or order status; retrieve those facts from your own systems. ## A useful first project For a cross-border team, classify English inquiries into quote, lead time, certification, and after-sales categories, then generate a draft for human approval. Measure accuracy, time saved, and edit rate instead of whether the answer merely sounds intelligent. > Official source: Google Gemini API Quickstart. This is a structured companion, not a replacement for Google's SDK, quota, or safety documentation. ### GPT API Quickstart: Build a Reliable Minimum Loop with OpenAI's Guide URL: https://www.laojinchuhai.com/en/tutorials/openai-gpt-api-quickstart ## Close the request loop first The value of OpenAI's quickstart is that it gets a model call working with very little code. The engineering rules are more important than the snippet: keep the key on the server, add timeouts and error handling, observe cost, and attach every request to a business operation. ```ts import OpenAI from "openai"; const client = new OpenAI({ apiKey: process.env.OPENAI_API_KEY }); const response = await client.responses.create({ model: "gpt-4.1-mini", input: "Classify this buyer inquiry: Can you quote 500 units?", }); console.log(response.output_text); ``` Model IDs and SDK versions change, so follow the current OpenAI documentation when deploying. ## From prose to a business output Define a contract before giving the model freedom: for example `intent`, `language`, `urgency`, and `draft_reply`. Validate the result on the server. Structured output is not about pretty JSON; it makes downstream automation safe. A validation failure should go to review, not be sent automatically. ## A maintainable prompt Keep role and boundaries, task and input, output format, and failure behavior explicit. Put changing prices and policies in retrieval or a database instead of a permanent prompt. ## Production checklist - Keep keys, model configuration, and secrets out of browser code. - Limit input length, sensitive data, and concurrency. - Track latency, token usage, failures, and human edit rate. - Route low-confidence or factual answers to review. - Maintain a fixed evaluation set before changing models. > Official source: OpenAI Quickstart. This article is a learning path; current models, fields, and pricing belong to the official documentation. ### GPT Prompt Engineering: Turn Good Chat into an Evaluable Workflow URL: https://www.laojinchuhai.com/en/tutorials/openai-prompt-engineering-guide ## Five reusable prompt modules A reliable prompt usually states the task, input material, constraints, output format, and acceptance criteria. Without one of these, the model has to guess and results drift. ### 1. Specify the task, not just the tone “Make it professional” is hard to evaluate. “Extract product, quantity, destination port, and lead time from this buyer email; return null for missing fields” is testable. Turn vague requests into actions and fields. ### 2. Supply references and boundaries State which facts must come from the supplied material and which gaps must be marked for confirmation. This matters for quotes, certifications, and logistics. ### 3. Use examples to calibrate format One to three strong input/output examples usually beat a page of adjectives. Include normal and edge cases: multiple products, mixed languages, and missing information. ### 4. Define the failure path Say “do not guess,” “ask for the missing field,” and “route sensitive cases to a human.” That turns risk into an operating procedure. ### 5. Iterate against an eval set Keep 20 to 50 anonymized real examples. After each prompt change, compare field accuracy, correct abstention, edit rate, and cost. Ship the version that improves measurable outcomes. > Official source: OpenAI Prompt Engineering Guide. This is an original methodology companion, not a reproduction of the official examples. ### Claude API Getting Started: From the First Message to Reliable Long-Context Work URL: https://www.laojinchuhai.com/en/tutorials/anthropic-claude-api-get-started ## The first Claude integration trap Do not interpret a large context window as permission to dump unlimited material into a request. Long-context work still needs chunking, deduplication, citations, and access control. A model can read a document without every sentence being true or applicable. ## A sensible integration order Start with one short Messages API request, add a system instruction, test a long-document summary, and only then add tool use. At every step record input size, latency, and human edit rate. ### System versus user Use system instructions for stable role, principles, and boundaries. Use the user message for the current task and materials. Changing prices, policies, and inventory belong in controlled context retrieved from business systems, not in a permanent system prompt. ### Long-document checkpoints Split documents into titled sections, ask the model to cite section names or excerpts, sample-check summaries, and require rule plus human approval before any output triggers fulfillment, refunds, or quotes. ### Tool boundaries Tools should be narrow-permission functions such as checking an order or inventory. Never give a model a universal arbitrary-code entry point by default. Validate arguments, user permissions, and side effects on the server. > Official source: Anthropic Claude API Getting Started. Follow Anthropic's current documentation for SDKs, model names, and safety guidance. ### The Hugging Face LLM Course: From Model Calls to Your Own Evaluation Set URL: https://www.laojinchuhai.com/en/tutorials/huggingface-llm-course-first-model ## How to study the course The Hugging Face LLM Course is valuable because it connects models, datasets, tokenizers, and training in one practical framework. Finish inference and data handling before fine-tuning. Teams often fine-tune before creating an evaluation set and merely hide the real problem. ## Three fundamentals A **tokenizer** converts text into tokens a model can process. A **pipeline** is a high-level entry point for quick experiments. The **model** is the actual architecture and weights doing inference. Validate the task with a pipeline before reaching for lower-level control. ## A first deliverable Take 30 anonymized real business texts and define inputs, expected outputs, and error labels. Run a classification or summarization task with a pretrained model and save results and latency. Report the error distribution, not one successful example. ## When to consider fine-tuning If the model lacks current policy, try retrieval first. If formatting is unstable, use structured output and evaluation first. Consider fine-tuning only when the task pattern is stable, data quality is controlled, and the base model still fails consistently. ## A safety baseline Remove names, phone numbers, addresses, order IDs, and prices before uploading data. Check licenses, weight provenance, and commercial restrictions individually. Open weights do not automatically mean unrestricted commercial use. > Official source: Hugging Face LLM Course. This article provides a learning sequence; use the course chapters and each model's license as the authority. ### Azure OpenAI Quickstart: Put GPT Behind Enterprise Access and Monitoring URL: https://www.laojinchuhai.com/en/tutorials/azure-openai-production-quickstart ## How Azure OpenAI differs With Azure OpenAI, a team usually creates an Azure resource and deploys a model first. Code uses the deployment name, not simply a model name. Identity, region, networking, and quota become part of the production decision. ## The minimum enterprise loop An administrator creates the resource and deployment; credentials are managed with managed identity or Key Vault; a backend service calls the model; logs, latency, errors, and cost are attributed to a team or project. Do not let every employee keep a key in browser code. ## Before production Verify deployment names and API versions, ensure the region meets data requirements, restrict network access, set budget and rate limits per team, redact sensitive logs, and keep a regression set for model or API changes. ## When Azure is the right choice If a customer already has identity, networking, auditing, and procurement on Azure, Azure OpenAI may reduce organizational integration cost. For a personal prototype, a direct provider API is often faster. Choose based on compliance and operational boundaries, not hype. > Official source: Microsoft Azure OpenAI Quickstart. Resources, deployments, authentication, and API versions change; follow Microsoft's current documentation before deployment. ### Microsoft AI for Beginners: Complete 27-Lesson Course (MIT Licensed) URL: https://www.laojinchuhai.com/en/tutorials/microsoft-ai-for-beginners-full-course ## About this course **Microsoft AI for Beginners** is Microsoft's official open-source AI curriculum (MIT License), written by Dmitry Soshnikov and other Microsoft engineers. With 30,000+ GitHub stars, it is one of the most popular AI learning paths in the world. This page republishes the complete English text of all 27 lessons under the MIT license. All images and internal links point to the original GitHub repository, and every lesson links back to its source file. ## Course map (27 lessons) | Section | Content | Level | |---------|---------|-------| | 0 · Course setup | Environment, running notebooks | Beginner | | 1 · Intro to AI | What is AI, weak/strong AI, Turing test, symbolic vs neural | Beginner | | 2 · Symbolic AI | Knowledge representation, expert systems | Beginner | | 3 · Neural Networks | Perceptron, MLP, own framework, PyTorch | Beginner→Intermediate | | 4 · Computer Vision | CNN, transfer learning, autoencoders, GANs, object detection, segmentation | Intermediate | | 5 · NLP | Text as tensors, embeddings, language models, RNN, generative, transformers, NER, LLMs | Intermediate | | 6 · Other | Genetic algorithms, deep RL, multi-agent systems | Intermediate | | 7 · Ethics | Responsible AI, bias, fairness | Beginner | | X · Extras | Multi-modal networks | Intermediate | ## License The lesson text below is © Microsoft Corporation, licensed under the MIT License. Full license: https://github.com/microsoft/AI-For-Beginners/blob/main/LICENSE --- --- ## Lesson 0-course-setup: Getting Started with this Curricula > 原文:https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/0-course-setup/setup.md # Getting Started with this Curricula ## Are you a student? Get started with the following resources: * [Student Hub page](https://docs.microsoft.com/learn/student-hub?WT.mc_id=academic-77998-cacaste) On this page, you will find beginner resources, Student packs, and even ways to get a free cert voucher. This is one page you want to bookmark and check from time to time as we switch out content at least monthly. * [Microsoft Student Learn ambassadors](https://studentambassadors.microsoft.com?WT.mc_id=academic-77998-cacaste) Join a global community of student ambassadors, this could be your way into Microsoft. **Students**, there are a couple of ways to use the curriculum. First of all, you can just read the text and look through the code directly on GitHub. If you want to run the code in any of the notebooks - [read our instructions](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/0-course-setup/how-to-run.md), and find more advice on how to do it [in this blog post](https://soshnikov.com/education/how-to-execute-notebooks-from-github/). > **Note**: [Instructions on how to run the code in this curriculum](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/0-course-setup/how-to-run.md) ## Self Study However, if you would like to take the course as a self-study project, we suggest that you fork the entire repo to your own GitHub account and complete the exercises on your own or with a group: * Start with a pre-lecture quiz. * Read the intro text for the lecture. * If the lecture has additional notebooks, go through them, reading and executing the code. If both TensorFlow and PyTorch notebooks are provided, you can focus on one of them - choose your favorite framework. * Notebooks often contain some of the challenges that require you to tweak the code a little bit to experiment. * Take the post-lecture quiz. * If there is a lab attached to the module - complete the assignment. * Visit the [Discussion board](https://github.com/microsoft/AI-For-Beginners/discussions) to "learn out loud". > For further study, we recommend following these [Microsoft Learn](https://docs.microsoft.com/en-us/users/dmitrysoshnikov-9132/collections/31zgizg2p418yo/?WT.mc_id=academic-77998-cacaste) modules and learning paths. **Teachers**, we have [included some suggestions](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/0-course-setup/for-teachers.md) on how to use this curriculum. --- ## Pedagogy We have chosen two pedagogical tenets while building this curriculum: ensuring that it is hands-on **project-based** and that it includes **frequent quizzes**. By ensuring that the content aligns with projects, the process is made more engaging for students and retention of concepts will be augmented. In addition, a low-stakes quiz before a class sets the intention of the student towards learning a topic, while a second quiz after class ensures further retention. This curriculum was designed to be flexible and fun and can be taken in whole or in part. The projects start small and become increasingly complex by the end of the 12-week cycle. > **A note about quizzes**: All quizzes are contained [in this app](https://red-field-0a6ddfd03.1.azurestaticapps.net/), for 50 total quizzes of three questions each. They are linked from within the lessons but the quiz app can be run locally; follow the instructions in the `etc/quiz-app` folder. ## Offline access You can run this documentation offline by using [Docsify](https://docsify.js.org/#/). Fork this repo, [install Docsify](https://docsify.js.org/#/quickstart) on your local machine, and then in the root folder of this repo, type `docsify serve`. The website will be served on port 3000 on your localhost: `localhost:3000`. A pdf of the curriculum is available [at this link](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons//etc/pdf/readme.pdf). --- ## Lesson 1-Intro: Introduction to AI > 原文:https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/1-Intro/README.md # Introduction to AI ![Summary of Introduction of AI content in a doodle](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/sketchnotes/ai-intro.png) > Sketchnote by [Tomomi Imura](https://twitter.com/girlie_mac) ## [Pre-lecture quiz](https://ff-quizzes.netlify.app/en/ai/quiz/1) **Artificial Intelligence** is an exciting scientific discipline that studies how we can make computers exhibit intelligent behavior, e.g. do those things that human beings are good at doing. Originally, computers were invented by [Charles Babbage](https://en.wikipedia.org/wiki/Charles_Babbage) to operate on numbers following a well-defined procedure - an algorithm. Modern computers, even though significantly more advanced than the original model proposed in the 19th century, still follow the same idea of controlled computations. Thus it is possible to program a computer to do something if we know the exact sequence of steps that we need to do in order to achieve the goal. ![Photo of a person](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/1-Intro/images/dsh_age.png) > Photo by [Vickie Soshnikova](http://twitter.com/vickievalerie) > ✅ Defining the age of a person from his or her photograph is a task that cannot be explicitly programmed, because we do not know how we come up with a number inside our head when we do it. --- There are some tasks, however, that we do not explicitly know how to solve. Consider determining the age of a person from his/her photograph. We somehow learn to do it, because we have seen many examples of people of different age, but we cannot explicitly explain how we do it, nor can we program the computer to do it. This is exactly the kind of task that are of interest to **Artificial Intelligence** (AI for short). ✅ Think of some tasks that you could offload to a computer that would benefit from AI. Consider the fields of finance, medicine, and the arts - how are these fields benefiting today from AI? ## Weak AI vs. Strong AI Weak AI | Strong AI ---------------------------------------|------------------------------------- Weak AI refers to AI systems that are designed and trained for a specific task or a narrow set of tasks.|Strong AI, or Artificial General Intelligence (AGI), refers to AI systems with human-level intelligence and understanding. These AI systems are not generally intelligent; they excel in performing a predefined task but lack true understanding or consciousness.|These AI systems have the ability to perform any intellectual task that a human being can do, adapt to different domains, and possess a form of consciousness or self-awareness. Examples of weak AI include virtual assistants like Siri or Alexa, recommendation algorithms used by streaming services, and chatbots that are designed for specific customer service tasks.|Achieving Strong AI is a long-term goal of AI research and would require the development of AI systems that can reason, learn, understand, and adapt across a wide range of tasks and contexts. Weak AI is highly specialized and does not possess human-like cognitive abilities or general problem-solving capabilities beyond its narrow domain.|Strong AI is currently a theoretical concept, and no AI system has reached this level of general intelligence. For more infomation refer to **[Artificial General Intelligence](https://en.wikipedia.org/wiki/Artificial_general_intelligence)** (AGI). ## The Definition of Intelligence and the Turing Test One of the problems when dealing with the term **[Intelligence](https://en.wikipedia.org/wiki/Intelligence)** is that there is no clear definition of this term. One can argue that intelligence is connected to **abstract thinking**, or to **self-awareness**, but we cannot properly define it. ![Photo of a Cat](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/1-Intro/images/photo-cat.jpg) > [Photo](https://unsplash.com/photos/75715CVEJhI) by [Amber Kipp](https://unsplash.com/@sadmax) from Unsplash To see the ambiguity of a term *intelligence*, try answering a question: "Is a cat intelligent?". Different people tend to give different answers to this question, as there is no universally accepted test to prove the assertion is true or not. And if you think there is - try running your cat through an IQ test... ✅ Think for a minute about how you define intelligence. Is a crow who can solve a maze and get at some food intelligent? Is a child intelligent? --- When speaking about AGI we need to have some way to tell if we have created a truly intelligent system. [Alan Turing](https://en.wikipedia.org/wiki/Alan_Turing) proposed a way called a **[Turing Test](https://en.wikipedia.org/wiki/Turing_test)**, which also acts like a definition of intelligence. The test compares a given system to something inherently intelligent - a real human being, and because any automatic comparison can be bypassed by a computer program, we use a human interrogator. So, if a human being is unable to distinguish between a real person and a computer system in text-based dialogue - the system is considered intelligent. > A chat-bot called [Eugene Goostman](https://en.wikipedia.org/wiki/Eugene_Goostman), developed in St.Petersburg, came close to passing the Turing test in 2014 by using a clever personality trick. It announced up front that it was a 13-year old Ukrainian boy, which would explain the lack of knowledge and some discrepancies in the text. The bot convinced 30% of the judges that it was human after a 5 minute dialogue, a metric that Turing believed a machine would be able to pass by 2000. However, one should understand that this does not indicate that we have created an intelligent system, or that a computer system has fooled the human interrogator - the system didn't fool the humans, but rather the bot creators did! ✅ Have you ever been fooled by a chat bot into thinking that you are speaking to a human? How did it convince you? ## Different Approaches to AI If we want a computer to behave like a human, we need somehow to model inside a computer our way of thinking. Consequently, we need to try to understand what makes a human being intelligent. > To be able to program intelligence into a machine, we need to understand how our own processes of making decisions work. If you do a little self-introspection, you will realize that there are some processes that happen subconsciously – eg. we can distinguish a cat from a dog without thinking about it - while some others involve reasoning. There are two possible approaches to this problem: Top-down Approach (Symbolic Reasoning) | Bottom-up Approach (Neural Networks) ---------------------------------------|------------------------------------- A top-down approach models the way a person reasons to solve a problem. It involves extracting **knowledge** from a human being, and representing it in a computer-readable form. We also need to develop a way to model **reasoning** inside a computer. | A bottom-up approach models the structure of a human brain, consisting of a huge number of simple units called **neurons**. Each neuron acts like a weighted average of its inputs, and we can train a network of neurons to solve useful problems by providing **training data**. There are also some other possible approaches to intelligence: * An **Emergent**, **Synergetic** or **multi-agent approach** are based on the fact that complex intelligent behaviour can be obtained by an interaction of a large number of simple agents. According to [evolutionary cybernetics](https://en.wikipedia.org/wiki/Global_brain#Evolutionary_cybernetics), intelligence can *emerge* from more simple, reactive behaviour in the process of *metasystem transition*. * An **Evolutionary approach**, or **genetic algorithm** is an optimization process based on the principles of evolution. We will consider those approaches later in the course, but right now we will focus on two main directions: top-down and bottom-up. ### The Top-Down Approach In a **top-down approach**, we try to model our reasoning. Because we can follow our thoughts when we reason, we can try to formalize this process and program it inside the computer. This is called **symbolic reasoning**. People tend to have some rules in their head that guide their decision making processes. For example, when a doctor is diagnosing a patient, he or she may realize that a person has a fever, and thus there might be some inflammation going on inside the body. By applying a large set of rules to a specific problem a doctor may be able to come up with the final diagnosis. This approach relies heavily on **knowledge representation** and **reasoning**. Extracting knowledge from a human expert might be the most difficult part, because a doctor in many cases would not know exactly why he or she is coming up with a particular diagnosis. Sometimes the solution just comes up in his or her head without explicit thinking. Some tasks, such as determining the age of a person from a photograph, cannot be at all reduced to manipulating knowledge. ### Bottom-Up Approach Alternately, we can try to model the simplest elements inside our brain – a neuron. We can construct a so-called **artificial neural network** inside a computer, and then try to teach it to solve problems by giving it examples. This process is similar to how a newborn child learns about his or her surroundings by making observations. ✅ Do a little research on how babies learn. What are the basic elements of a baby's brain? > | What about ML? | | > |--------------|-----------| > | Part of Artificial Intelligence that is based on computer learning to solve a problem based on some data is called **Machine Learning**. We will not consider classical machine learning in this course - we refer you to a separate [Machine Learning for Beginners](http://aka.ms/ml-beginners) curriculum. | ![ML for Beginners](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/1-Intro/images/ml-for-beginners.png) | ## A Brief History of AI Artificial Intelligence was started as a field in the middle of the twentieth century. Initially, symbolic reasoning was a prevalent approach, and it led to a number of important successes, such as expert systems – computer programs that were able to act as an expert in some limited problem domains. However, it soon became clear that such approach does not scale well. Extracting the knowledge from an expert, representing it in a computer, and keeping that knowledgebase accurate turns out to be a very complex task, and too expensive to be practical in many cases. This led to so-called [AI Winter](https://en.wikipedia.org/wiki/AI_winter) in the 1970s. Brief History of AI > Image by [Dmitry Soshnikov](http://soshnikov.com) As time passed, computing resources became cheaper, and more data has become available, so neural network approaches started demonstrating great performance in competing with human beings in many areas, such as computer vision or speech understanding. In the last decade, the term Artificial Intelligence has been mostly used as a synonym for Neural Networks, because most of the AI successes that we hear about are based on them. We can observe how the approaches changed, for example, in creating a chess playing computer program: * Early chess programs were based on search – a program explicitly tried to estimate possible moves of an opponent for a given number of next moves, and selected an optimal move based on the optimal position that can be achieved in a few moves. It led to the development of the so-called [alpha-beta pruning](https://en.wikipedia.org/wiki/Alpha%E2%80%93beta_pruning) search algorithm. * Search strategies work well toward the end of the game, where the search space is limited by a small number of possible moves. However, at the beginning of the game, the search space is huge, and the algorithm can be improved by learning from existing matches between human players. Subsequent experiments employed so-called [case-based reasoning](https://en.wikipedia.org/wiki/Case-based_reasoning), where the program looked for cases in the knowledge base very similar to the current position in the game. * Modern programs that win over human players are based on neural networks and [reinforcement learning](https://en.wikipedia.org/wiki/Reinforcement_learning), where the programs learn to play solely by playing a long time against themselves and learning from their own mistakes – much like human beings do when learning to play chess. However, a computer program can play many more games in much less time, and thus can learn much faster. ✅ Do a little research on other games that have been played by AI. Similarly, we can see how the approach towards creating “talking programs” (that might pass the Turing test) changed: * Early programs of this kind such as [Eliza](https://en.wikipedia.org/wiki/ELIZA), were based on very simple grammatical rules and the re-formulation of the input sentence into a question. * Modern assistants, such as Cortana, Siri or Google Assistant are all hybrid systems that use Neural networks to convert speech into text and recognize our intent, and then employ some reasoning or explicit algorithms to perform required actions. * In the future, we may expect a complete neural-based model to handle dialogue by itself. The recent GPT and [Turing-NLG](https://www.microsoft.com/research/blog/turing-nlg-a-17-billion-parameter-language-model-by-microsoft) family of neural networks show great success in this. the Turing test's evolution > Image by Dmitry Soshnikov, [photo](https://unsplash.com/photos/r8LmVbUKgns) by [Marina Abrosimova](https://unsplash.com/@abrosimova_marina_foto), Unsplash ## Recent AI Research The huge recent growth in neural network research started around 2010, when large public datasets started to become available. A huge collection of images called [ImageNet](https://en.wikipedia.org/wiki/ImageNet), which contains around 14 million annotated images, gave birth to the [ImageNet Large Scale Visual Recognition Challenge](https://image-net.org/challenges/LSVRC/). ![ILSVRC Accuracy](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/1-Intro/images/ilsvrc.gif) > Image by [Dmitry Soshnikov](http://soshnikov.com) In 2012, [Convolutional Neural Networks](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/4-ComputerVision/07-ConvNets/README.md) were first used in image classification, which led to a significant drop in classification errors (from almost 30% to 16.4%). In 2015, ResNet architecture from Microsoft Research [achieved human-level accuracy](https://doi.org/10.1109/ICCV.2015.123). Since then, Neural Networks demonstrated very successful behaviour in many tasks: --- Year | Human Parity achieved -----|-------- 2015 | [Image Classification](https://doi.org/10.1109/ICCV.2015.123) 2016 | [Conversational Speech Recognition](https://arxiv.org/abs/1610.05256) 2018 | [Automatic Machine Translation](https://arxiv.org/abs/1803.05567) (Chinese-to-English) 2020 | [Image Captioning](https://arxiv.org/abs/2009.13682) Over the past few years we have witnessed huge successes with large language models, such as BERT and GPT-3. This happened mostly due to the fact that there is a lot of general text data available that allows us to train models to capture the structure and meaning of texts, pre-train them on general text collections, and then specialize those models for more specific tasks. We will learn more about [Natural Language Processing](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/5-NLP/README.md) later in this course. ## 🚀 Challenge Do a tour of the internet to determine where, in your opinion, AI is most effectively used. Is it in a Mapping app, or some speech-to-text service or a video game? Research how the system was built. ## [Post-lecture quiz](https://ff-quizzes.netlify.app/en/ai/quiz/2) ## Review & Self Study Review the history of AI and ML by reading through [this lesson](https://github.com/microsoft/ML-For-Beginners/tree/main/1-Introduction/2-history-of-ML). Take an element from the sketchnote at the top of that lesson or this one and research it in more depth to understand the cultural context informing its evolution. **Assignment**: [Game Jam](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/1-Intro/assignment.md) --- ## Lesson 2-Symbolic: Knowledge Representation and Expert Systems > 原文:https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/2-Symbolic/README.md # Knowledge Representation and Expert Systems ![Summary of Symbolic AI content](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/sketchnotes/ai-symbolic.png) > Sketchnote by [Tomomi Imura](https://twitter.com/girlie_mac) The quest for artificial intelligence is based on a search for knowledge, to make sense of the world similar to how humans do. But how can you go about doing this? ## [Pre-lecture quiz](https://ff-quizzes.netlify.app/en/ai/quiz/3) In the early days of AI, the top-down approach to creating intelligent systems (discussed in the previous lesson) was popular. The idea was to extract the knowledge from people into some machine-readable form, and then use it to automatically solve problems. This approach was based on two big ideas: * Knowledge Representation * Reasoning ## Knowledge Representation One of the important concepts in Symbolic AI is **knowledge**. It is important to differentiate knowledge from *information* or *data*. For example, one can say that books contain knowledge, because one can study books and become an expert. However, what books contain is actually called *data*, and by reading books and integrating this data into our world model we convert this data to knowledge. > ✅ **Knowledge** is something which is contained in our head and represents our understanding of the world. It is obtained by an active **learning** process, which integrates pieces of information that we receive into our active model of the world. Most often, we do not strictly define knowledge, but we align it with other related concepts using [DIKW Pyramid](https://en.wikipedia.org/wiki/DIKW_pyramid). It contains the following concepts: * **Data** is something represented in physical media, such as written text or spoken words. Data exists independently of human beings and can be passed between people. * **Information** is how we interpret data in our head. For example, when we hear the word *computer*, we have some understanding of what it is. * **Knowledge** is information being integrated into our world model. For example, once we learn what a computer is, we start having some ideas about how it works, how much it costs, and what it can be used for. This network of interrelated concepts forms our knowledge. * **Wisdom** is yet one more level of our understanding of the world, and it represents *meta-knowledge*, eg. some notion on how and when the knowledge should be used. *Image [from Wikipedia](https://commons.wikimedia.org/w/index.php?curid=37705247), By Longlivetheux - Own work, CC BY-SA 4.0* Thus, the problem of **knowledge representation** is to find some effective way to represent knowledge inside a computer in the form of data, to make it automatically usable. This can be seen as a spectrum: ![Knowledge representation spectrum](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/2-Symbolic/images/knowledge-spectrum.png) > Image by [Dmitry Soshnikov](http://soshnikov.com) * On the left, there are very simple types of knowledge representations that can be effectively used by computers. The simplest one is algorithmic, when knowledge is represented by a computer program. This, however, is not the best way to represent knowledge, because it is not flexible. Knowledge inside our head is often non-algorithmic. * On the right, there are representations such as natural text. It is the most powerful, but cannot be used for automatic reasoning. > ✅ Think for a minute about how you represent knowledge in your head and convert it to notes. Is there a particular format that works well for you to aid in retention? ## Classifying Computer Knowledge Representations We can classify different computer knowledge representation methods in the following categories: * **Network representations** are based on the fact that we have a network of interrelated concepts inside our head. We can try to reproduce the same networks as a graph inside a computer - a so-called **semantic network**. 1. **Object-Attribute-Value triplets** or **attribute-value pairs**. Since a graph can be represented inside a computer as a list of nodes and edges, we can represent a semantic network by a list of triplets, containing objects, attributes, and values. For example, we build the following triplets about programming languages: Object | Attribute | Value -------|-----------|------ Python | is | Untyped-Language Python | invented-by | Guido van Rossum Python | block-syntax | indentation Untyped-Language | doesn't have | type definitions > ✅ Think how triplets can be used to represent other types of knowledge. 2. **Hierarchical representations** emphasize the fact that we often create a hierarchy of objects inside our head. For example, we know that canary is a bird, and all birds have wings. We also have some idea about what colour a canary usually is, and what is their flight speed. - **Frame representation** is based on representing each object or class of objects as a **frame** which contains **slots**. Slots have possible default values, value restrictions, or stored procedures that can be called to obtain the value of a slot. All frames form a hierarchy similar to an object hierarchy in object-oriented programming languages. - **Scenarios** are special kind of frames that represent complex situations that can unfold in time. **Python** Slot | Value | Default value | Interval | -----|-------|---------------|----------| Name | Python | | | Is-A | Untyped-Language | | | Variable Case | | CamelCase | | Program Length | | | 5-5000 lines | Block Syntax | Indent | | | 3. **Procedural representations** are based on representing knowledge by a list of actions that can be executed when a certain condition occurs. - Production rules are if-then statements that allow us to draw conclusions. For example, a doctor can have a rule saying that **IF** a patient has high fever **OR** high level of C-reactive protein in blood test **THEN** he has an inflammation. Once we encounter one of the conditions, we can make a conclusion about inflammation, and then use it in further reasoning. - Algorithms can be considered another form of procedural representation, although they are almost never used directly in knowledge-based systems. 4. **Logic** was originally proposed by Aristotle as a way to represent universal human knowledge. - Predicate Logic as a mathematical theory is too rich to be computable, therefore some subset of it is normally used, such as Horn clauses used in Prolog. - Descriptive Logic is a family of logical systems used to represent and reason about hierarchies of objects distributed knowledge representations such as *semantic web*. ## Expert Systems One of the early successes of symbolic AI were so-called **expert systems** - computer systems that were designed to act as an expert in some limited problem domain. They were based on a **knowledge base** extracted from one or more human experts, and they contained an **inference engine** that performed some reasoning on top of it. ![Human Architecture](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/2-Symbolic/images/arch-human.png) | ![Knowledge-Based System](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/2-Symbolic/images/arch-kbs.png) ---------------------------------------------|------------------------------------------------ Simplified structure of a human neural system | Architecture of a knowledge-based system Expert systems are built like the human reasoning system, which contains **short-term memory** and **long-term memory**. Similarly, in knowledge-based systems we distinguish the following components: * **Problem memory**: contains the knowledge about the problem being currently solved, i.e. the temperature or blood pressure of a patient, whether he has inflammation or not, etc. This knowledge is also called **static knowledge**, because it contains a snapshot of what we currently know about the problem - the so-called *problem state*. * **Knowledge base**: represents long-term knowledge about a problem domain. It is extracted manually from human experts, and does not change from consultation to consultation. Because it allows us to navigate from one problem state to another, it is also called **dynamic knowledge**. * **Inference engine**: orchestrates the whole process of searching in the problem state space, asking questions of the user when necessary. It is also responsible for finding the right rules to be applied to each state. As an example, let's consider the following expert system of determining an animal based on its physical characteristics: ![AND-OR Tree](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/2-Symbolic/images/AND-OR-Tree.png) > Image by [Dmitry Soshnikov](http://soshnikov.com) This diagram is called an **AND-OR tree**, and it is a graphical representation of a set of production rules. Drawing a tree is useful at the beginning of extracting knowledge from the expert. To represent the knowledge inside the computer it is more convenient to use rules: ``` IF the animal eats meat OR (animal has sharp teeth AND animal has claws AND animal has forward-looking eyes ) THEN the animal is a carnivore ``` You can notice that each condition on the left-hand-side of the rule and the action are essentially object-attribute-value (OAV) triplets. **Working memory** contains the set of OAV triplets that correspond to the problem currently being solved. A **rules engine** looks for rules for which a condition is satisfied and applies them, adding another triplet to the working memory. > ✅ Write your own AND-OR tree on a topic you like! ### Forward vs. Backward Inference The process described above is called **forward inference**. It starts with some initial data about the problem available in the working memory, and then executes the following reasoning loop: 1. If the target attribute is present in the working memory - stop and give the result 2. Look for all the rules whose condition is currently satisfied - obtain **conflict set** of rules. 3. Perform **conflict resolution** - select one rule that will be executed on this step. There could be different conflict resolution strategies: - Select the first applicable rule in the knowledge base - Select a random rule - Select a *more specific* rule, i.e. the one meeting the most conditions in the "left-hand-side" (LHS) 4. Apply selected rule and insert new piece of knowledge into the problem state 5. Repeat from step 1. However, in some cases we might want to start with an empty knowledge about the problem, and ask questions that will help us arrive to the conclusion. For example, when doing medical diagnosis, we usually do not perform all medical analyses in advance before starting diagnosing the patient. We rather want to perform analyses when a decision needs to be made. This process can be modeled using **backward inference**. It is driven by the **goal** - the attribute value that we are looking to find: 1. Select all rules that can give us the value of a goal (i.e. with the goal on the RHS ("right-hand-side")) - a conflict set 1. If there are no rules for this attribute, or there is a rule saying that we should ask the value from the user - ask for it, otherwise: 1. Use conflict resolution strategy to select one rule that we will use as *hypothesis* - we will try to prove it 1. Recurrently repeat the process for all attributes in the LHS of the rule, trying to prove them as goals 1. If at any point the process fails - use another rule at step 3. > ✅ In which situations is forward inference more appropriate? How about backward inference? ### Implementing Expert Systems Expert systems can be implemented using different tools: * Programming them directly in some high level programming language. This is not the best idea, because the main advantage of a knowledge-based system is that knowledge is separated from inference, and potentially a problem domain expert should be able to write rules without understanding the details of the inference process * Using **expert systems shell**, i.e. a system specifically designed to be populated by knowledge using some knowledge representation language. ## ✍️ Exercise: Animal Inference See [Animals.ipynb](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/2-Symbolic/Animals.ipynb) for an example of implementing forward and backward inference expert system. > **Note**: This example is rather simple, and only gives the idea of how an expert system looks like. Once you start creating such a system, you will only notice some *intelligent* behaviour from it once you reach certain number of rules, around 200+. At some point, rules become too complex to keep all of them in mind, and at this point you may start wondering why a system makes certain decisions. However, the important characteristics of knowledge-based systems is that you can always *explain* exactly how any of the decisions were made. ## Ontologies and the Semantic Web At the end of 20th century there was an initiative to use knowledge representation to annotate Internet resources, so that it would be possible to find resources that correspond to very specific queries. This motion was called **Semantic Web**, and it relied on several concepts: - A special knowledge representation based on **[description logics](https://en.wikipedia.org/wiki/Description_logic)** (DL). It is similar to frame knowledge representation, because it builds a hierarchy of objects with properties, but it has formal logical semantics and inference. There is a whole family of DLs which balance between expressiveness and algorithmic complexity of inference. - Distributed knowledge representation, where all concepts are represented by a global URI identifier, making it possible to create knowledge hierarchies that span the internet. - A family of XML-based languages for knowledge description: RDF (Resource Description Framework), RDFS (RDF Schema), OWL (Ontology Web Language). A core concept in the Semantic Web is a concept of **Ontology**. It refers to a explicit specification of a problem domain using some formal knowledge representation. The simplest ontology can be just a hierarchy of objects in a problem domain, but more complex ontologies will include rules that can be used for inference. In the semantic web, all representations are based on triplets. Each object and each relation are uniquely identified by the URI. For example, if we want to state the fact that this AI Curriculum has been developed by Dmitry Soshnikov on Jan 1st, 2022 - here are the triplets we can use: ``` http://github.com/microsoft/ai-for-beginners http://www.example.com/terms/creation-date “Jan 1, 2022” http://github.com/microsoft/ai-for-beginners http://purl.org/dc/elements/1.1/creator http://soshnikov.com ``` > ✅ Here `http://www.example.com/terms/creation-date` and `http://purl.org/dc/elements/1.1/creator` are some well-known and universally accepted URIs to express the concepts of *creator* and *creation date*. In a more complex case, if we want to define a list of creators, we can use some data structures defined in RDF. > Diagrams above by [Dmitry Soshnikov](http://soshnikov.com) The progress of building the Semantic Web was somehow slowed down by the success of search engines and natural language processing techniques, which allow extracting structured data from text. However, in some areas there are still significant efforts to maintain ontologies and knowledge bases. A few projects worth noting: * [WikiData](https://wikidata.org/) is a collection of machine readable knowledge bases associated with Wikipedia. Most of the data is mined from Wikipedia *InfoBoxes*, pieces of structured content inside Wikipedia pages. You can [query](https://query.wikidata.org/) wikidata in SPARQL, a special query language for Semantic Web. Here is a sample query that displays most popular eye colors among humans: ```sparql #defaultView:BubbleChart SELECT ?eyeColorLabel (COUNT(?human) AS ?count) WHERE { ?human wdt:P31 wd:Q5. # human instance-of homo sapiens ?human wdt:P1340 ?eyeColor. # human eye-color ?eyeColor SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } } GROUP BY ?eyeColorLabel ``` * [DBpedia](https://www.dbpedia.org/) is another effort similar to WikiData. > ✅ If you want to experiment with building your own ontologies, or opening existing ones, there is a great visual ontology editor called [Protégé](https://protege.stanford.edu/). Download it, or use it online. *Web Protégé editor open with the Romanov Family ontology. Screenshot by Dmitry Soshnikov* ## ✍️ Exercise: A Family Ontology See [FamilyOntology.ipynb](https://github.com/Ezana135/AI-For-Beginners/blob/main/lessons/2-Symbolic/FamilyOntology.ipynb) for an example of using Semantic Web techniques to reason about family relationships. We will take a family tree represented in common GEDCOM format and an ontology of family relationships and build a graph of all family relationships for given set of individuals. ## Microsoft Concept Graph In most of the cases, ontologies are carefully created by hand. However, it is also possible to **mine** ontologies from unstructured data, for example, from natural language texts. One such attempt was done by Microsoft Research, and resulted in [Microsoft Concept Graph](https://blogs.microsoft.com/ai/microsoft-researchers-release-graph-that-helps-machines-conceptualize/?WT.mc_id=academic-77998-cacaste). It is a large collection of entities grouped together using `is-a` inheritance relationship. It allows answering questions like "What is Microsoft?" - the answer being something like "a company with probability 0.87, and a brand with probability 0.75". The Graph is available either as REST API, or as a large downloadable text file that lists all entity pairs. ## ✍️ Exercise: A Concept Graph Try the [MSConceptGraph.ipynb](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/2-Symbolic/MSConceptGraph.ipynb) notebook to see how we can use Microsoft Concept Graph to group news articles into several categories. ## Conclusion Nowadays, AI is often considered to be a synonym for *Machine Learning* or *Neural Networks*. However, a human being also exhibits explicit reasoning, which is something currently not being handled by neural networks. In real world projects, explicit reasoning is still used to perform tasks that require explanations, or being able to modify the behavior of the system in a controlled way. ## 🚀 Challenge In the Family Ontology notebook associated to this lesson, there is an opportunity to experiment with other family relations. Try to discover new connections between people in the family tree. ## [Post-lecture quiz](https://ff-quizzes.netlify.app/en/ai/quiz/4) ## Review & Self Study Do some research on the internet to discover areas where humans have tried to quantify and codify knowledge. Take a look at Bloom's Taxonomy, and go back in history to learn how humans tried to make sense of their world. Explore the work of Linnaeus to create a taxonomy of organisms, and observe the way Dmitri Mendeleev created a way for chemical elements to be described and grouped. What other interesting examples can you find? **Assignment**: [Build an Ontology](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/2-Symbolic/assignment.md) --- ## Lesson 3-NeuralNetworks: Introduction to Neural Networks > 原文:https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/3-NeuralNetworks/README.md # Introduction to Neural Networks ![Summary of Intro Neural Networks content in a doodle](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/sketchnotes/ai-neuralnetworks.png) As we discussed in the introduction, one of the ways to achieve intelligence is to train a **computer model** or an **artificial brain**. Since the middle of 20th century, researchers tried different mathematical models, until in recent years this direction proved to be hugely successful. Such mathematical models of the brain are called **neural networks**. > Sometimes neural networks are called *Artificial Neural Networks*, ANNs, in order to indicate that we are talking about models, not real networks of neurons. ## Machine Learning Neural Networks are a part of a larger discipline called **Machine Learning**, whose goal is to use data to train computer models that are able to solve problems. Machine Learning constitutes a large part of Artificial Intelligence, however, we do not cover classical ML in this curricula. > Visit our separate **[Machine Learning for Beginners](http://github.com/microsoft/ml-for-beginners)** curriculum to learn more about classic Machine Learning. In Machine Learning, we assume that we have some dataset of examples **X**, and corresponding output values **Y**. Examples are often N-dimensional vectors that consist of **features**, and outputs are called **labels**. We will consider the two most common machine learning problems: * **Classification**, where we need to classify an input object into two or more classes. * **Regression**, where we need to predict a numerical number for each of the input samples. > When representing inputs and outputs as tensors, the input dataset is a matrix of size M×N, where M is number of samples and N is the number of features. Output labels Y is the vector of size M. In this curriculum, we will only focus on neural network models. ## A Model of a Neuron From biology, we know that our brain consists of neural cells (neurons), each of them having multiple "inputs" (dendrites) and a single "output" (axon). Both dendrites and axons can conduct electrical signals, and the connections between them — known as synapses — can exhibit varying degrees of conductivity, which are regulated by neurotransmitters. ![Model of a Neuron](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/3-NeuralNetworks/images/synapse-wikipedia.jpg) | ![Model of a Neuron](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/3-NeuralNetworks/images/artneuron.png) ----|---- Real Neuron *([Image](https://en.wikipedia.org/wiki/Synapse#/media/File:SynapseSchematic_lines.svg) from Wikipedia)* | Artificial Neuron *(Image by Author)* Thus, the simplest mathematical model of a neuron contains several inputs X1, ..., XN and an output Y, and a series of weights W1, ..., WN. An output is calculated as: Y = f\left(\sum_{i=1}^N X_iW_i\right) where f is some non-linear **activation function**. > Early models of neuron were described in the classical paper [A logical calculus of the ideas immanent in nervous activity](https://www.cs.cmu.edu/~./epxing/Class/10715/reading/McCulloch.and.Pitts.pdf) by Warren McCullock and Walter Pitts in 1943. Donald Hebb in his book "[The Organization of Behavior: A Neuropsychological Theory](https://books.google.com/books?id=VNetYrB8EBoC)" proposed the way those networks can be trained. ## In this Section In this section we will learn about: * [Perceptron](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/3-NeuralNetworks/03-Perceptron/README.md), one of the earliest neural network models for two-class classification * [Multi-layered networks](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/3-NeuralNetworks/04-OwnFramework/README.md) with a paired notebook [how to build our own framework](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/3-NeuralNetworks/04-OwnFramework/OwnFramework.ipynb) * [Neural Network Frameworks](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/3-NeuralNetworks/05-Frameworks/README.md), with these notebooks: [PyTorch](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/3-NeuralNetworks/05-Frameworks/IntroPyTorch.ipynb) and [Keras/Tensorflow](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/3-NeuralNetworks/05-Frameworks/IntroKerasTF.ipynb) * [Overfitting](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/3-NeuralNetworks/05-Frameworks) --- ## Lesson 3-NeuralNetworks: Introduction to Neural Networks: Perceptron > 原文:https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/3-NeuralNetworks/03-Perceptron/README.md # Introduction to Neural Networks: Perceptron ## [Pre-lecture quiz](https://ff-quizzes.netlify.app/en/ai/quiz/5) One of the first attempts to implement something similar to a modern neural network was done by Frank Rosenblatt from Cornell Aeronautical Laboratory in 1957. It was a hardware implementation called "Mark-1", designed to recognize primitive geometric figures, such as triangles, squares and circles. | | | |--------------|-----------| |Frank Rosenblatt | The Mark 1 Perceptron| > Images [from Wikipedia](https://en.wikipedia.org/wiki/Perceptron) An input image was represented by 20x20 photocell array, so the neural network had 400 inputs and one binary output. A simple network contained one neuron, also called a **threshold logic unit**. Neural network weights acted like potentiometers that required manual adjustment during the training phase. > ✅ A potentiometer is a device that allows the user to adjust the resistance of a circuit. > The New York Times wrote about perceptron at that time: *the embryo of an electronic computer that [the Navy] expects will be able to walk, talk, see, write, reproduce itself and be conscious of its existence.* ## Perceptron Model Suppose we have N features in our model, in which case the input vector would be a vector of size N. A perceptron is a **binary classification** model, i.e. it can distinguish between two classes of input data. We will assume that for each input vector x the output of our perceptron would be either +1 or -1, depending on the class. The output will be computed using the formula: y(x) = f(wTx) where f is a step activation function ## Training the Perceptron To train a perceptron we need to find a weights vector w that classifies most of the values correctly, i.e. results in the smallest **error**. This error E is defined by **perceptron criterion** in the following manner: E(w) = -∑wTxiti where: * the sum is taken on those training data points i that result in the wrong classification * xi is the input data, and ti is either -1 or +1 for negative and positive examples accordingly. This criteria is considered as a function of weights w, and we need to minimize it. Often, a method called **gradient descent** is used, in which we start with some initial weights w(0), and then at each step update the weights according to the formula: w(t+1) = w(t) - η∇E(w) Here η is the so-called **learning rate**, and ∇E(w) denotes the **gradient** of E. After we calculate the gradient, we end up with w(t+1) = w(t) + ∑ηxiti The algorithm in Python looks like this: ```python def train(positive_examples, negative_examples, num_iterations = 100, eta = 1): weights = [0,0,0] # Initialize weights (almost randomly :) for i in range(num_iterations): pos = random.choice(positive_examples) neg = random.choice(negative_examples) z = np.dot(pos, weights) # compute perceptron output if z < 0: # positive example classified as negative weights = weights + eta*weights.shape z = np.dot(neg, weights) if z >= 0: # negative example classified as positive weights = weights - eta*weights.shape return weights ``` ## Conclusion In this lesson, you learned about a perceptron, which is a binary classification model, and how to train it by using a weights vector. ## 🚀 Challenge If you'd like to try to build your own perceptron, try [this lab on Microsoft Learn](https://docs.microsoft.com/en-us/azure/machine-learning/component-reference/two-class-averaged-perceptron?WT.mc_id=academic-77998-cacaste) which uses the [Azure ML designer](https://docs.microsoft.com/en-us/azure/machine-learning/concept-designer?WT.mc_id=academic-77998-cacaste). ## [Post-lecture quiz](https://ff-quizzes.netlify.app/en/ai/quiz/6) ## Review & Self Study To see how we can use perceptron to solve a toy problem as well as real-life problems, and to continue learning - go to [Perceptron](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/3-NeuralNetworks/03-Perceptron/Perceptron.ipynb) notebook. Here's an interesting [article about perceptrons](https://towardsdatascience.com/what-is-a-perceptron-basics-of-neural-networks-c4cfea20c590 ) as well. ## [Assignment](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/3-NeuralNetworks/03-Perceptron/lab/README.md) In this lesson, we have implemented a perceptron for binary classification task, and we have used it to classify between two handwritten digits. In this lab, you are asked to solve the problem of digit classification entirely, i.e. determine which digit is most likely to correspond to a given image. * [Instructions](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/3-NeuralNetworks/03-Perceptron/lab/README.md) * [Notebook](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/3-NeuralNetworks/03-Perceptron/lab/PerceptronMultiClass.ipynb) --- ## Lesson 3-NeuralNetworks: Introduction to Neural Networks. Multi-Layered Perceptron > 原文:https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/3-NeuralNetworks/04-OwnFramework/README.md # Introduction to Neural Networks. Multi-Layered Perceptron In the previous section, you learned about the simplest neural network model - one-layered perceptron, a linear two-class classification model. In this section we will extend this model into a more flexible framework, allowing us to: * perform **multi-class classification** in addition to two-class * solve **regression problems** in addition to classification * separate classes that are not linearly separable We will also develop our own modular framework in Python that will allow us to construct different neural network architectures. ## [Pre-lecture quiz](https://ff-quizzes.netlify.app/en/ai/quiz/7) ## Formalization of Machine Learning Let's start with formalizing the Machine Learning problem. Suppose we have a training dataset **X** with labels **Y**, and we need to build a model *f* that will make most accurate predictions. The quality of predictions is measured by **Loss function** ℒ. The following loss functions are often used: * For regression problem, when we need to predict a number, we can use **absolute error** ∑i|f(x(i))-y(i)|, or **squared error** ∑i(f(x(i))-y(i))2 * For classification, we use **0-1 loss** (which is essentially the same as **accuracy** of the model), or **logistic loss**. For one-level perceptron, function *f* was defined as a linear function *f(x)=wx+b* (here *w* is the weight matrix, *x* is the vector of input features, and *b* is bias vector). For different neural network architectures, this function can take more complex form. > In the case of classification, it is often desirable to get probabilities of corresponding classes as network output. To convert arbitrary numbers to probabilities (eg. to normalize the output), we often use **softmax** function σ, and the function *f* becomes *f(x)=σ(wx+b)* In the definition of *f* above, *w* and *b* are called **parameters** θ=⟨*w,b*⟩. Given the dataset ⟨**X**,**Y**⟩, we can compute an overall error on the whole dataset as a function of parameters θ. > ✅ **The goal of neural network training is to minimize the error by varying parameters θ** ## Gradient Descent Optimization There is a well-known method of function optimization called **gradient descent**. The idea is that we can compute a derivative (in multi-dimensional case called **gradient**) of loss function with respect to parameters, and vary parameters in such a way that the error would decrease. This can be formalized as follows: * Initialize parameters by some random values w(0), b(0) * Repeat the following step many times: - w(i+1) = w(i)-η∂ℒ/∂w - b(i+1) = b(i)-η∂ℒ/∂b During training, the optimization steps are supposed to be calculated considering the whole dataset (remember that loss is calculated as a sum through all training samples). However, in real life we take small portions of the dataset called **minibatches**, and calculate gradients based on a subset of data. Because subset is taken randomly each time, such method is called **stochastic gradient descent** (SGD). ## Multi-Layered Perceptrons and Backpropagation One-layer network, as we have seen above, is capable of classifying linearly separable classes. To build a richer model, we can combine several layers of the network. Mathematically it would mean that the function *f* would have a more complex form, and will be computed in several steps: * z1=w1x+b1 * z2=w2α(z1)+b2 * f = σ(z2) Here, α is a **non-linear activation function**, σ is a softmax function, and parameters θ=<*w1,b1,w2,b2*>. The gradient descent algorithm would remain the same, but it would be more difficult to calculate gradients. Given the chain differentiation rule, we can calculate derivatives as: * ∂ℒ/∂w2 = (∂ℒ/∂σ)(∂σ/∂z2)(∂z2/∂w2) * ∂ℒ/∂w1 = (∂ℒ/∂σ)(∂σ/∂z2)(∂z2/∂α)(∂α/∂z1)(∂z1/∂w1) > ✅ The chain differentiation rule is used to calculate derivatives of the loss function with respect to parameters. Note that the left-most part of all those expressions is the same, and thus we can effectively calculate derivatives starting from the loss function and going "backwards" through the computational graph. Thus the method of training a multi-layered perceptron is called **backpropagation**, or 'backprop'. compute graph > TODO: image citation > ✅ We will cover backprop in much more detail in our notebook example. ## Conclusion In this lesson, we have built our own neural network library, and we have used it for a simple two-dimensional classification task. ## 🚀 Challenge In the accompanying notebook, you will implement your own framework for building and training multi-layered perceptrons. You will be able to see in detail how modern neural networks operate. Proceed to the [OwnFramework](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/3-NeuralNetworks/04-OwnFramework/OwnFramework.ipynb) notebook and work through it. ## [Post-lecture quiz](https://ff-quizzes.netlify.app/en/ai/quiz/8) ## Review & Self Study Backpropagation is a common algorithm used in AI and ML, worth studying [in more detail](https://wikipedia.org/wiki/Backpropagation) ## [Assignment](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/3-NeuralNetworks/04-OwnFramework/lab/README.md) In this lab, you are asked to use the framework you constructed in this lesson to solve MNIST handwritten digit classification. * [Instructions](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/3-NeuralNetworks/04-OwnFramework/lab/README.md) * [Notebook](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/3-NeuralNetworks/04-OwnFramework/lab/MyFW_MNIST.ipynb) --- ## Lesson 3-NeuralNetworks: Neural Network Frameworks > 原文:https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/3-NeuralNetworks/05-Frameworks/README.md # Neural Network Frameworks As we have learned already, to be able to train neural networks efficiently we need to do two things: * To operate on tensors, eg. to multiply, add, and compute some functions such as sigmoid or softmax * To compute gradients of all expressions, in order to perform gradient descent optimization ## [Pre-lecture quiz](https://ff-quizzes.netlify.app/en/ai/quiz/9) While the `numpy` library can do the first part, we need some mechanism to compute gradients. In [our framework](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/3-NeuralNetworks/04-OwnFramework/OwnFramework.ipynb) that we have developed in the previous section we had to manually program all derivative functions inside the `backward` method, which does backpropagation. Ideally, a framework should give us the opportunity to compute gradients of *any expression* that we can define. Another important thing is to be able to perform computations on GPU, or any other specialized compute units, such as [TPU](https://en.wikipedia.org/wiki/Tensor_Processing_Unit). Deep neural network training requires *a lot* of computations, and to be able to parallelize those computations on GPUs is very important. > ✅ The term 'parallelize' means to distribute the computations over multiple devices. Currently, the two most popular neural frameworks are: [TensorFlow](http://TensorFlow.org) and [PyTorch](https://pytorch.org/). Both provide a low-level API to operate with tensors on both CPU and GPU. On top of the low-level API, there is also higher-level API, called [Keras](https://keras.io/) and [PyTorch Lightning](https://pytorchlightning.ai/) correspondingly. Low-Level API | [TensorFlow](http://TensorFlow.org) | [PyTorch](https://pytorch.org/) --------------|-------------------------------------|-------------------------------- High-level API| [Keras](https://keras.io/) | [PyTorch Lightning](https://pytorchlightning.ai/) **Low-level APIs** in both frameworks allow you to build so-called **computational graphs**. This graph defines how to compute the output (usually the loss function) with given input parameters, and can be pushed for computation on GPU, if it is available. There are functions to differentiate this computational graph and compute gradients, which can then be used for optimizing model parameters. **High-level APIs** pretty much consider neural networks as a **sequence of layers**, and make constructing most of the neural networks much easier. Training the model usually requires preparing the data and then calling a `fit` function to do the job. The high-level API allows you to construct typical neural networks very quickly without worrying about lots of details. At the same time, low-level API offer much more control over the training process, and thus they are used a lot in research, when you are dealing with new neural network architectures. It is also important to understand that you can use both APIs together, eg. you can develop your own network layer architecture using low-level API, and then use it inside the larger network constructed and trained with the high-level API. Or you can define a network using the high-level API as a sequence of layers, and then use your own low-level training loop to perform optimization. Both APIs use the same basic underlying concepts, and they are designed to work well together. ## Learning In this course, we offer most of the content both for PyTorch and TensorFlow. You can choose your preferred framework and only go through the corresponding notebooks. If you are not sure which framework to choose, read some discussions on the internet regarding **PyTorch vs. TensorFlow**. You can also have a look at both frameworks to get better understanding. Where possible, we will use High-Level APIs for simplicity. However, we believe it is important to understand how neural networks work from the ground up, thus in the beginning we start by working with low-level API and tensors. However, if you want to get going fast and do not want to spend a lot of time on learning these details, you can skip those and go straight into high-level API notebooks. ## ✍️ Exercises: Frameworks Continue your learning in the following notebooks: Low-Level API | [TensorFlow+Keras Notebook](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/3-NeuralNetworks/05-Frameworks/IntroKerasTF.ipynb) | [PyTorch](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/3-NeuralNetworks/05-Frameworks/IntroPyTorch.ipynb) --------------|-------------------------------------|-------------------------------- High-level API| [Keras](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/3-NeuralNetworks/05-Frameworks/IntroKeras.ipynb) | *PyTorch Lightning* After mastering the frameworks, let's recap the notion of overfitting. # Overfitting Overfitting is an extremely important concept in machine learning, and it is very important to get it right! Consider the following problem of approximating 5 dots (represented by `x` on the graphs below): ![linear](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/3-NeuralNetworks/images/overfit1.jpg) | ![overfit](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/3-NeuralNetworks/images/overfit2.jpg) -------------------------|-------------------------- **Linear model, 2 parameters** | **Non-linear model, 7 parameters** Training error = 5.3 | Training error = 0 Validation error = 5.1 | Validation error = 20 * On the left, we see a good straight line approximation. Because the number of parameters is adequate, the model gets the idea behind point distribution right. * On the right, the model is too powerful. Because we only have 5 points and the model has 7 parameters, it can adjust in such a way as to pass through all points, making training the error to be 0. However, this prevents the model from understanding the correct pattern behind data, thus the validation error is very high. It is very important to strike a correct balance between the richness of the model (number of parameters) and the number of training samples. ## Why overfitting occurs * Not enough training data * Too powerful model * Too much noise in input data ## How to detect overfitting As you can see from the graph above, overfitting can be detected by a very low training error, and a high validation error. Normally during training we will see both training and validation errors starting to decrease, and then at some point validation error might stop decreasing and start rising. This will be a sign of overfitting, and the indicator that we should probably stop training at this point (or at least make a snapshot of the model). ![overfitting](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/3-NeuralNetworks/images/Overfitting.png) ## How to prevent overfitting If you can see that overfitting occurs, you can do one of the following: * Increase the amount of training data * Decrease the complexity of the model * Use some [regularization technique](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/4-ComputerVision/08-TransferLearning/TrainingTricks.md), such as [Dropout](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/4-ComputerVision/08-TransferLearning/TrainingTricks.md), which we will consider later. ## Overfitting and Bias-Variance Tradeoff Overfitting is actually a case of a more generic problem in statistics called [Bias-Variance Tradeoff](https://en.wikipedia.org/wiki/Bias%E2%80%93variance_tradeoff). If we consider the possible sources of error in our model, we can see two types of errors: * **Bias errors** are caused by our algorithm not being able to capture the relationship between training data correctly. It can result from the fact that our model is not powerful enough (**underfitting**). * **Variance errors**, which are caused by the model approximating noise in the input data instead of meaningful relationship (**overfitting**). During training, bias error decreases (as our model learns to approximate the data), and variance error increases. It is important to stop training - either manually (when we detect overfitting) or automatically (by introducing regularization) - to prevent overfitting. ## Conclusion In this lesson, you learned about the differences between the various APIs for the two most popular AI frameworks, TensorFlow and PyTorch. In addition, you learned about a very important topic, overfitting. ## 🚀 Challenge In the accompanying notebooks, you will find 'tasks' at the bottom; work through the notebooks and complete the tasks. ## [Post-lecture quiz](https://ff-quizzes.netlify.app/en/ai/quiz/10) ## Review & Self Study Do some research on the following topics: - TensorFlow - PyTorch - Overfitting Ask yourself the following questions: - What is the difference between TensorFlow and PyTorch? - What is the difference between overfitting and underfitting? ## [Assignment](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/3-NeuralNetworks/05-Frameworks/lab/README.md) In this lab, you are asked to solve two classification problems using single- and multi-layered fully-connected networks using PyTorch or TensorFlow. * [Instructions](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/3-NeuralNetworks/05-Frameworks/lab/README.md) * [Notebook](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/3-NeuralNetworks/05-Frameworks/lab/LabFrameworks.ipynb) --- ## Lesson 4-ComputerVision: Introduction to Computer Vision > 原文:https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/4-ComputerVision/06-IntroCV/README.md # Introduction to Computer Vision [Computer Vision](https://wikipedia.org/wiki/Computer_vision) is a discipline whose aim is to allow computers to gain high-level understanding of digital images. This is quite a broad definition, because *understanding* can mean many different things, including finding an object on a picture (**object detection**), understanding what is happening (**event detection**), describing a picture in text, or reconstructing a scene in 3D. There are also special tasks related to human images: age and emotion estimation, face detection and identification, and 3D pose estimation, to name a few. ## [Pre-lecture quiz](https://ff-quizzes.netlify.app/en/ai/quiz/11) One of the simplest tasks of computer vision is **image classification**. Computer vision is often considered to be a branch of AI. Nowadays, most of computer vision tasks are solved using neural networks. We will learn more about the special type of neural networks used for computer vision, [convolutional neural networks](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/4-ComputerVision/07-ConvNets/README.md), throughout this section. However, before you pass the image to a neural network, in many cases it makes sense to use some algorithmic techniques to enhance the image. There are several Python libraries available for image processing: * **[imageio](https://imageio.readthedocs.io/en/stable/)** can be used for reading/writing different image formats. It also support ffmpeg, a useful tool to convert video frames to images. * **[Pillow](https://pillow.readthedocs.io/en/stable/index.html)** (also known as PIL) is a bit more powerful, and also supports some image manipulation such as morphing, palette adjustments, and more. * **[OpenCV](https://opencv.org/)** is a powerful image processing library written in C++, which has become the *de facto* standard for image processing. It has a convenient Python interface. * **[dlib](http://dlib.net/)** is a C++ library that implements many machine learning algorithms, including some of the Computer Vision algorithms. It also has a Python interface, and can be used for challenging tasks such as face and facial landmark detection. ## OpenCV [OpenCV](https://opencv.org/) is considered to be the *de facto* standard for image processing. It contains a lot of useful algorithms, implemented in C++. You can call OpenCV from Python as well. A good place to learn OpenCV is [this Learn OpenCV course](https://learnopencv.com/getting-started-with-opencv/). In our curriculum, our goal is not to learn OpenCV, but to show you some examples when it can be used, and how. ### Loading Images Images in Python can be conveniently represented by NumPy arrays. For example, grayscale images with the size of 320x200 pixels would be stored in a 200x320 array, and color images of the same dimension would have shape of 200x320x3 (for 3 color channels). To load an image, you can use the following code: ```python import cv2 import matplotlib.pyplot as plt im = cv2.imread('image.jpeg') plt.imshow(im) ``` Traditionally, OpenCV uses BGR (Blue-Green-Red) encoding for color images, while the rest of Python tools use the more traditional RGB (Red-Green-Blue). For the image to look right, you need to convert it to the RGB color space, either by swapping dimensions in the NumPy array, or by calling an OpenCV function: ```python im = cv2.cvtColor(im,cv2.COLOR_BGR2RGB) ``` The same `cvtColor` function can be used to perform other color space transformations such as converting an image to grayscale or to the HSV (Hue-Saturation-Value) color space. You can also use OpenCV to load video frame-by-frame - an example is given in the exercise [OpenCV Notebook](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/4-ComputerVision/06-IntroCV/OpenCV.ipynb). ### Image Processing Before feeding an image to a neural network, you may want to apply several pre-processing steps. OpenCV can do many things, including: * **Resizing** the image using `im = cv2.resize(im, (320,200),interpolation=cv2.INTER_LANCZOS)` * **Blurring** the image using `im = cv2.medianBlur(im,3)` or `im = cv2.GaussianBlur(im, (3,3), 0)` * Changing the **brightness and contrast** of the image can be done by NumPy array manipulations, as described [in this Stackoverflow note](https://stackoverflow.com/questions/39308030/how-do-i-increase-the-contrast-of-an-image-in-python-opencv). * Using [thresholding](https://docs.opencv.org/4.x/d7/d4d/tutorial_py_thresholding.html) by calling `cv2.threshold`/`cv2.adaptiveThreshold` functions, which is often preferable to adjusting brightness or contrast. * Applying different [transformations](https://docs.opencv.org/4.5.5/da/d6e/tutorial_py_geometric_transformations.html) to the image: - **[Affine transformations](https://docs.opencv.org/4.5.5/d4/d61/tutorial_warp_affine.html)** can be useful if you need to combine rotation, resizing and skewing to the image and you know the source and destination location of three points in the image. Affine transformations keep parallel lines parallel. - **[Perspective transformations](https://medium.com/analytics-vidhya/opencv-perspective-transformation-9edffefb2143)** can be useful when you know the source and destination positions of 4 points in the image. For example, if you take a picture of a rectangular document via a smartphone camera from some angle, and you want to make a rectangular image of the document itself. * Understanding movement inside the image by using **[optical flow](https://docs.opencv.org/4.5.5/d4/dee/tutorial_optical_flow.html)**. ## Examples of using Computer Vision In our [OpenCV Notebook](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/4-ComputerVision/06-IntroCV/OpenCV.ipynb), we give some examples of when computer vision can be used to perform specific tasks: * **Pre-processing a photograph of a Braille book**. We focus on how we can use thresholding, feature detection, perspective transformation and NumPy manipulations to separate individual Braille symbols for further classification by a neural network. ![Braille Image](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/4-ComputerVision/06-IntroCV/data/braille.jpeg) | ![Braille Image Pre-processed](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/4-ComputerVision/06-IntroCV/images/braille-result.png) | ![Braille Symbols](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/4-ComputerVision/06-IntroCV/images/braille-symbols.png) ----|-----|----- > Image from [OpenCV.ipynb](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/4-ComputerVision/06-IntroCV/OpenCV.ipynb) * **Detecting motion in video using frame difference**. If the camera is fixed, then frames from the camera feed should be pretty similar to each other. Since frames are represented as arrays, just by subtracting those arrays for two subsequent frames we will get the pixel difference, which should be low for static frames, and become higher once there is substantial motion in the image. ![Image of video frames and frame differences](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/4-ComputerVision/06-IntroCV/images/frame-difference.png) > Image from [OpenCV.ipynb](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/4-ComputerVision/06-IntroCV/OpenCV.ipynb) * **Detecting motion using Optical Flow**. [Optical flow](https://docs.opencv.org/3.4/d4/dee/tutorial_optical_flow.html) allows us to understand how individual pixels on video frames move. There are two types of optical flow: - **Dense Optical Flow** computes the vector field that shows for each pixel where is it moving - **Sparse Optical Flow** is based on taking some distinctive features in the image (eg. edges), and building their trajectory from frame to frame. ![Image of Optical Flow](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/4-ComputerVision/06-IntroCV/images/optical.png) > Image from [OpenCV.ipynb](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/4-ComputerVision/06-IntroCV/OpenCV.ipynb) ## ✍️ Example Notebooks: OpenCV [try OpenCV in Action](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/4-ComputerVision/06-IntroCV/OpenCV.ipynb) Let's do some experiments with OpenCV by exploring [OpenCV Notebook](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/4-ComputerVision/06-IntroCV/OpenCV.ipynb) ## Conclusion Sometimes, relatively complex tasks such as movement detection or fingertip detection can be solved purely by computer vision. Thus, it is very helpful to know the basic techniques of computer vision, and what libraries like OpenCV can do. ## 🚀 Challenge Watch [this video](https://docs.microsoft.com/shows/ai-show/ai-show--2021-opencv-ai-competition--grand-prize-winners--cortic-tigers--episode-32?WT.mc_id=academic-77998-cacaste) from the AI show to learn about the Cortic Tigers project and how they built a block-based solution to democratize computer vision tasks via a robot. Do some research on other projects like this that help onboard new learners into the field. ## [Post-lecture quiz](https://ff-quizzes.netlify.app/en/ai/quiz/12) ## Review & Self Study Read more on optical flow [in this great tutorial](https://learnopencv.com/optical-flow-in-opencv/). ## [Assignment](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/4-ComputerVision/06-IntroCV/lab/README.md) In this lab, you will take a video with simple gestures, and your goal is to extract up/down/left/right movements using optical flow. Palm Movement Frame --- ## Lesson 4-ComputerVision: Convolutional Neural Networks > 原文:https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/4-ComputerVision/07-ConvNets/README.md # Convolutional Neural Networks We have seen before that neural networks are quite good at dealing with images, and even one-layer perceptron is able to recognize handwritten digits from MNIST dataset with reasonable accuracy. However, the MNIST dataset is very special, and all digits are centered inside the image, which makes the task simpler. ## [Pre-lecture quiz](https://ff-quizzes.netlify.app/en/ai/quiz/13) In real life, we want to be able to recognize objects on a picture regardless of their exact location in the image. Computer vision is different from generic classification, because when we are trying to find a certain object in the picture, we are scanning the image looking for some specific **patterns** and their combinations. For example, when looking for a cat, we first may look for horizontal lines, which can form whiskers, and then certain a combination of whiskers can tell us that it is actually a picture of a cat. Relative position and presence of certain patterns is important, and not their exact position on the image. To extract patterns, we will use the notion of **convolutional filters**. As you know, an image is represented by a 2D-matrix, or a 3D-tensor with color depth. Applying a filter means that we take relatively small **filter kernel** matrix, and for each pixel in the original image we compute the weighted average with neighboring points. We can view this like a small window sliding over the whole image, and averaging out all pixels according to the weights in the filter kernel matrix. ![Vertical Edge Filter](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/4-ComputerVision/07-ConvNets/images/filter-vert.png) | ![Horizontal Edge Filter](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/4-ComputerVision/07-ConvNets/images/filter-horiz.png) ----|---- > Image by Dmitry Soshnikov For example, if we apply 3x3 vertical edge and horizontal edge filters to the MNIST digits, we can get highlights (e.g. high values) where there are vertical and horizontal edges in our original image. Thus those two filters can be used to "look for" edges. Similarly, we can design different filters to look for other low-level patterns: > Image of [Leung-Malik Filter Bank](https://www.robots.ox.ac.uk/~vgg/research/texclass/filters.html) However, while we can design the filters to extract some patterns manually, we can also design the network in such a way that it will learn the patterns automatically. It is one of the main ideas behind the CNN. ## Main ideas behind CNN The way CNNs work is based on the following important ideas: * Convolutional filters can extract patterns * We can design the network in such a way that filters are trained automatically * We can use the same approach to find patterns in high-level features, not only in the original image. Thus CNN feature extraction work on a hierarchy of features, starting from low-level pixel combinations, up to higher level combination of picture parts. ![Hierarchical Feature Extraction](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/4-ComputerVision/07-ConvNets/images/FeatureExtractionCNN.png) > Image from [a paper by Hislop-Lynch](https://www.semanticscholar.org/paper/Computer-vision-based-pedestrian-trajectory-Hislop-Lynch/26e6f74853fc9bbb7487b06dc2cf095d36c9021d), based on [their research](https://dl.acm.org/doi/abs/10.1145/1553374.1553453) ## ✍️ Exercises: Convolutional Neural Networks Let's continue exploring how convolutional neural networks work, and how we can achieve trainable filters, by working through the corresponding notebooks: * [Convolutional Neural Networks - PyTorch](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/4-ComputerVision/07-ConvNets/ConvNetsPyTorch.ipynb) * [Convolutional Neural Networks - TensorFlow](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/4-ComputerVision/07-ConvNets/ConvNetsTF.ipynb) ## Pyramid Architecture Most of the CNNs used for image processing follow a so-called pyramid architecture. The first convolutional layer applied to the original images typically has a relatively low number of filters (8-16), which correspond to different pixel combinations, such as horizontal/vertical lines of strokes. At the next level, we reduce the spatial dimension of the network, and increase the number of filters, which corresponds to more possible combinations of simple features. With each layer, as we move towards the final classifier, spatial dimensions of the image decrease, and the number of filters grow. As an example, let's look at the architecture of VGG-16, a network that achieved 92.7% accuracy in ImageNet's top-5 classification in 2014: ![ImageNet Layers](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/4-ComputerVision/07-ConvNets/images/vgg-16-arch1.jpg) ![ImageNet Pyramid](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/4-ComputerVision/07-ConvNets/images/vgg-16-arch.jpg) > Image from [Researchgate](https://www.researchgate.net/figure/Vgg16-model-structure-To-get-the-VGG-NIN-model-we-replace-the-2-nd-4-th-6-th-7-th_fig2_335194493) ## Best-Known CNN Architectures [Continue your study about the best-known CNN architectures](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/4-ComputerVision/07-ConvNets/CNN_Architectures.md) --- ## Lesson 4-ComputerVision: Pre-trained Networks and Transfer Learning > 原文:https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/4-ComputerVision/08-TransferLearning/README.md # Pre-trained Networks and Transfer Learning Training CNNs can take a lot of time, and a lot of data is required for that task. However, much of the time is spent learning the best low-level filters that a network can use to extract patterns from images. A natural question arises - can we use a neural network trained on one dataset and adapt it to classify different images without requiring a full training process? ## [Pre-lecture quiz](https://ff-quizzes.netlify.app/en/ai/quiz/15) This approach is called **transfer learning**, because we transfer some knowledge from one neural network model to another. In transfer learning, we typically start with a pre-trained model, which has been trained on some large image dataset, such as **ImageNet**. Those models can already do a good job extracting different features from generic images, and in many cases just building a classifier on top of those extracted features can yield a good result. > ✅ Transfer Learning is a term you find in other academic fields, such as Education. It refers to the process of taking knowledge from one domain and applying it to another. ## Pre-Trained Models as Feature Extractors The convolutional networks that we have talked about in the previous section contained a number of layers, each of which is supposed to extract some features from the image, starting from low-level pixel combinations (such as horizontal/vertical line or stroke), up to higher level combinations of features, corresponding to things like an eye of a flame. If we train CNN on sufficiently large dataset of generic and diverse images, the network should learn to extract those common features. Both Keras and PyTorch contain functions to easily load pre-trained neural network weights for some common architectures, most of which were trained on ImageNet images. The most often used ones are described on the [CNN Architectures](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/4-ComputerVision/07-ConvNets/CNN_Architectures.md) page from the prior lesson. In particular, you may want to consider using one of the following: * **VGG-16/VGG-19** which are relatively simple models that still give good accuracy. Often using VGG as a first attempt is a good choice to see how transfer learning is working. * **ResNet** is a family of models proposed by Microsoft Research in 2015. They have more layers, and thus take more resources. * **MobileNet** is a family of models with reduced size, suitable for mobile devices. Use them if you are short in resources and can sacrifice a little bit of accuracy. Here are sample features extracted from a picture of a cat by VGG-16 network: ![Features extracted by VGG-16](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/4-ComputerVision/08-TransferLearning/images/features.png) ## Cats vs. Dogs Dataset In this example, we will use a dataset of [Cats and Dogs](https://www.microsoft.com/download/details.aspx?id=54765&WT.mc_id=academic-77998-cacaste), which is very close to a real-life image classification scenario. ## ✍️ Exercise: Transfer Learning Let's see transfer learning in action in corresponding notebooks: * [Transfer Learning - PyTorch](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/4-ComputerVision/08-TransferLearning/TransferLearningPyTorch.ipynb) * [Transfer Learning - TensorFlow](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/4-ComputerVision/08-TransferLearning/TransferLearningTF.ipynb) ## Visualizing Adversarial Cat Pre-trained neural network contains different patterns inside it's *brain*, including notions of **ideal cat** (as well as ideal dog, ideal zebra, etc.). It would be interesting to somehow **visualize this image**. However, it is not simple, because patterns are spread all over the network weights, and also organized in a hierarchical structure. One approach we can take is to start with a random image, and then try to use **gradient descent optimization** technique to adjust that image in such a way, that the network starts thinking that it's a cat. ![Image Optimization Loop](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/4-ComputerVision/08-TransferLearning/images/ideal-cat-loop.png) However, if we do this, we will receive something very similar to a random noise. This is because *there are many ways to make network think the input image is a cat*, including some that do not make sense visually. While those images contain a lot of patterns typical for a cat, there is nothing to constrain them to be visually distinctive. To improve the result, we can add another term into the loss function, which is called **variation loss**. It is a metric that shows how similar neighboring pixels of the image are. Minimizing variation loss makes image smoother, and gets rid of noise - thus revealing more visually appealing patterns. Here is an example of such "ideal" images, that are classified as cat and as zebra with high probability: ![Ideal Cat](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/4-ComputerVision/08-TransferLearning/images/ideal-cat.png) | ![Ideal Zebra](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/4-ComputerVision/08-TransferLearning/images/ideal-zebra.png) -----|----- *Ideal Cat* | *Ideal Zebra* Similar approach can be used to perform so-called **adversarial attacks** on a neural network. Suppose we want to fool a neural network and make a dog look like a cat. If we take dog's image, which is recognized by a network as a dog, we can then tweak it a little but using gradient descent optimization, until the network starts classifying it as a cat: ![Picture of a Dog](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/4-ComputerVision/08-TransferLearning/images/original-dog.png) | ![Picture of a dog classified as a cat](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/4-ComputerVision/08-TransferLearning/images/adversarial-dog.png) -----|----- *Original picture of a dog* | *Picture of a dog classified as a cat* See the code to reproduce the results above in the following notebook: * [Ideal and Adversarial Cat - TensorFlow](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/4-ComputerVision/08-TransferLearning/AdversarialCat_TF.ipynb) ## Conclusion Using transfer learning, you are able to quickly put together a classifier for a custom object classification task and achieve high accuracy. You can see that more complex tasks that we are solving now require higher computational power, and cannot be easily solved on the CPU. In the next unit, we will try to use a more lightweight implementation to train the same model using lower compute resources, which results in just slightly lower accuracy. ## 🚀 Challenge In the accompanying notebooks, there are notes at the bottom about how transfer knowledge works best with somewhat similar training data (a new type of animal, perhaps). Do some experimentation with completely new types of images to see how well or poorly your transfer knowledge models perform. ## [Post-lecture quiz](https://ff-quizzes.netlify.app/en/ai/quiz/16) ## Review & Self Study Read through [TrainingTricks.md](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/4-ComputerVision/08-TransferLearning/TrainingTricks.md) to deepen your knowledge of some other way to train your models. ## [Assignment](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/4-ComputerVision/08-TransferLearning/lab/README.md) In this lab, we will use real-life [Oxford-IIIT](https://www.robots.ox.ac.uk/~vgg/data/pets/) pets dataset with 35 breeds of cats and dogs, and we will build a transfer learning classifier. --- ## Lesson 4-ComputerVision: Autoencoders > 原文:https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/4-ComputerVision/09-Autoencoders/README.md # Autoencoders When training CNNs, one of the problems is that we need a lot of labeled data. In the case of image classification, we need to separate images into different classes, which is a manual effort. ## [Pre-lecture quiz](https://ff-quizzes.netlify.app/en/ai/quiz/17) However, we might want to use raw (unlabeled) data for training CNN feature extractors, which is called **self-supervised learning**. Instead of labels, we will use training images as both network input and output. The main idea of **autoencoder** is that we will have an **encoder network** that converts input image into some **latent space** (normally it is just a vector of some smaller size), then the **decoder network**, whose goal would be to reconstruct the original image. > ✅ An [autoencoder](https://wikipedia.org/wiki/Autoencoder) is "a type of artificial neural network used to learn efficient codings of unlabeled data." Since we are training an autoencoder to capture as much of the information from the original image as possible for accurate reconstruction, the network tries to find the best **embedding** of input images to capture the meaning.л. ![AutoEncoder Diagram](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/4-ComputerVision/09-Autoencoders/images/autoencoder_schema.jpg) > Image from [Keras blog](https://blog.keras.io/building-autoencoders-in-keras.html) ## Scenarios for using Autoencoders While reconstructing original images does not seem useful in its own right, there are a few scenarios where autoencoders are especially useful: * **Lowering the dimension of images for visualization** or **training image embeddings**. Usually autoencoders give better results than PCA, because it takes into account spatial nature of images and hierarchical features. * **Denoising**, i.e. removing noise from the image. Because noise carries out a lot of useless information, autoencoder cannot fit it all into relatively small latent space, and thus it captures only important part of the image. When training denoisers, we start with original images, and use images with artificially added noise as input for autoencoder. * **Super-resolution**, increasing image resolution. We start with high-resolution images, and use the image with lower resolution as the autoencoder input. * **Generative models**. Once we train the autoencoder, the decoder part can be used to create new objects starting from random latent vectors. ## Variational Autoencoders (VAE) Traditional autoencoders reduce the dimension of the input data somehow, figuring out the important features of input images. However, latent vectors ofter do not make much sense. In other words, taking MNIST dataset as an example, figuring out which digits correspond to different latent vectors is not an easy task, because close latent vectors would not necessarily correspond to the same digits. On the other hand, to train *generative* models it is better to have some understanding of the latent space. This idea leads us to **variational auto-encoder** (VAE). VAE is the autoencoder that learns to predict *statistical distribution* of the latent parameters, so-called **latent distribution**. For example, we may want latent vectors to be distributed normally with some mean zmean and standard deviation zsigma (both mean and standard deviation are vectors of some dimensionality d). Encoder in VAE learns to predict those parameters, and then decoder takes a random vector from this distribution to reconstruct the object. To summarize: * From input vector, we predict `z_mean` and `z_log_sigma` (instead of predicting the standard deviation itself, we predict its logarithm) * We sample a vector `sample` from the distribution N(zmean,exp(zlog\_sigma)) * The decoder tries to decode the original image using `sample` as an input vector > Image from [this blog post](https://ijdykeman.github.io/ml/2016/12/21/cvae.html) by Isaak Dykeman Variational auto-encoders use a complex loss function that consists of two parts: * **Reconstruction loss** is the loss function that shows how close a reconstructed image is to the target (it can be Mean Squared Error, or MSE). It is the same loss function as in normal autoencoders. * **KL loss**, which ensures that latent variable distributions stays close to normal distribution. It is based on the notion of [Kullback-Leibler divergence](https://www.countbayesie.com/blog/2017/5/9/kullback-leibler-divergence-explained) - a metric to estimate how similar two statistical distributions are. One important advantage of VAEs is that they allow us to generate new images relatively easily, because we know which distribution from which to sample latent vectors. For example, if we train VAE with 2D latent vector on MNIST, we can then vary components of the latent vector to get different digits: vaemnist > Image by [Dmitry Soshnikov](http://soshnikov.com) Observe how images blend into each other, as we start getting latent vectors from the different portions of the latent parameter space. We can also visualize this space in 2D: vaemnist cluster > Image by [Dmitry Soshnikov](http://soshnikov.com) ## ✍️ Exercises: Autoencoders Learn more about autoencoders in these corresponding notebooks: * [Autoencoders in TensorFlow](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/4-ComputerVision/09-Autoencoders/AutoencodersTF.ipynb) * [Autoencoders in PyTorch](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/4-ComputerVision/09-Autoencoders/AutoEncodersPyTorch.ipynb) ## Properties of Autoencoders * **Data Specific** - they only work well with the type of images they have been trained on. For example, if we train a super-resolution network on flowers, it will not work well on portraits. This is because the network can produce higher resolution image by taking fine details from features learned from the training dataset. * **Lossy** - the reconstructed image is not the same as the original image. The nature of loss is defined by the *loss function* used during training * Works on **unlabeled data** ## [Post-lecture quiz](https://ff-quizzes.netlify.app/en/ai/quiz/18) ## Conclusion In this lesson, you learned about the various types of autoencoders available to the AI scientist. You learned how to build them, and how to use them to reconstruct images. You also learned about the VAE and how to use it to generate new images. ## 🚀 Challenge In this lesson, you learned about using autoencoders for images. But they can also be used for music! Check out the Magenta project's [MusicVAE](https://magenta.tensorflow.org/music-vae) project, which uses autoencoders to learn to reconstruct music. Do some [experiments](https://colab.research.google.com/github/magenta/magenta-demos/blob/master/colab-notebooks/Multitrack_MusicVAE.ipynb) with this library to see what you can create. ## [Post-lecture quiz](https://ff-quizzes.netlify.app/en/ai/quiz/16) ## Review & Self Study For reference, read more about autoencoders in these resources: * [Building Autoencoders in Keras](https://blog.keras.io/building-autoencoders-in-keras.html) * [Blog post on NeuroHive](https://neurohive.io/ru/osnovy-data-science/variacionnyj-avtojenkoder-vae/) * [Variational Autoencoders Explained](https://kvfrans.com/variational-autoencoders-explained/) * [Conditional Variational Autoencoders](https://ijdykeman.github.io/ml/2016/12/21/cvae.html) ## Assignment At the end of [this notebook using TensorFlow](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/4-ComputerVision/09-Autoencoders/AutoencodersTF.ipynb), you will find a 'task' - use this as your assignment. --- ## Lesson 4-ComputerVision: Generative Adversarial Networks > 原文:https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/4-ComputerVision/10-GANs/README.md # Generative Adversarial Networks In the previous section, we learned about **generative models**: models that can generate new images similar to the ones in the training dataset. VAE was a good example of a generative model. ## [Pre-lecture quiz](https://ff-quizzes.netlify.app/en/ai/quiz/19) However, if we try to generate something really meaningful, like a painting at reasonable resolution, with VAE, we will see that training does not converge well. For this use case, we should learn about another architecture specifically targeted at generative models - **Generative Adversarial Networks**, or GANs. The main idea of a GAN is to have two neural networks that will be trained against each other: > Image by [Dmitry Soshnikov](http://soshnikov.com) > ✅ A little vocabulary: > * **Generator** is a network that takes some random vector, and produces the image as a result > * **Discriminator** is a network that takes an image, and it should tell whether it is a real image (from training dataset), or it was generated by a generator. It is essentially an image classifier. ### Discriminator The architecture of discriminator does not differ from an ordinary image classification network. In the simplest case it can be fully-connected classifier, but most probably it will be a [convolutional network](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/4-ComputerVision/07-ConvNets/README.md). > ✅ A GAN based on convolutional networks is called a [DCGAN](https://arxiv.org/pdf/1511.06434.pdf) A CNN discriminator consists of the following layers: several convolutions+poolings (with decreasing spatial size) and, one-or-more fully-connected layers to get "feature vector", final binary classifier. > ✅ A 'pooling' in this context is a technique that reduces the size of the image. "Pooling layers reduce the dimensions of data by combining the outputs of neuron clusters at one layer into a single neuron in the next layer." - [source](https://wikipedia.org/wiki/Convolutional_neural_network#Pooling_layers) ### Generator A Generator is slightly more tricky. You can consider it to be a reversed discriminator. Starting from a latent vector (in place of a feature vector), it has a fully-connected layer to convert it into the required size/shape, followed by deconvolutions+upscaling. This is similar to *decoder* part of [autoencoder](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/4-ComputerVision/09-Autoencoders/README.md). > ✅ Because the convolution layer is implemented as a linear filter traversing the image, deconvolution is essentially similar to convolution, and can be implemented using the same layer logic. > Image by [Dmitry Soshnikov](http://soshnikov.com) ### Training the GAN GANs are called **adversarial** because there is a constant competition between the generator and the discriminator. During this competition, both generator and discriminator improve, thus the network learns to produce better and better pictures. The training happens in two stages: * **Training the discriminator**. This task is pretty straightforward: we generate a batch of images by the generator, labeling them 0, which stands for fake image, and taking a batch of images from the input dataset (with label 1, real image). We obtain some *discriminator loss*, and perform backprop. * **Training the generator**. This is slightly more tricky, because we do not know the expected output for the generator directly. We take the whole GAN network consisting of a generator followed by discriminator, feed it with some random vectors, and expect the result to be 1 (corresponding to real images). We then freeze the parameters of the discriminator (we do not want it to be trained at this step), and perform the backprop. During this process, both the generator and the discriminator losses are not going down significantly. In the ideal situation, they should oscillate, corresponding to both networks improving their performance. ## ✍️ Exercises: GANs * [GAN Notebook in TensorFlow/Keras](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/4-ComputerVision/10-GANs/GANTF.ipynb) * [GAN Notebook in PyTorch](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/4-ComputerVision/10-GANs/GANPyTorch.ipynb) ### Problems with GAN training GANs are known to be especially difficult to train. Here are a few problems: * **Mode Collapse**. By this term we mean that the generator learns to produce one successful image that tricks the generator, and not a variety of different images. * **Sensitivity to hyperparameters**. Often you can see that a GAN does not converge at all, and then suddenly decreases in the learning rate leading to convergence. * Keeping a **balance** between the generator and the discriminator. In many cases discriminator loss can drop to zero relatively quickly, which results in the generator being unable to train further. To overcome this, we can try setting different learning rates for the generator and discriminator, or skip discriminator training if the loss is already too low. * Training for **high resolution**. Reflecting the same problem as with autoencoders, this problem is triggered because reconstructing too many layers of convolutional network leads to artifacts. This problem is typically solved with so-called **progressive growing**, when first a few layers are trained on low-res images, and then layers are "unblocked" or added. Another solution would be adding extra connections between layers and training several resolutions at once - see this [Multi-Scale Gradient GANs paper](https://arxiv.org/abs/1903.06048) for details. ## Style Transfer GANs is a great way to generate artistic images. Another interesting technique is so-called **style transfer**, which takes one **content image**, and re-draws it in a different style, applying filters from **style image**. The way it works is the following: * We start with a random noise image (or with a content image, but for the sake of understanding it is easier to start from random noise) * Our goal would be to create such an image, that would be close to both content image and style image. This would be determined by two loss functions: - **Content loss** is computed based on the features extracted by the CNN at some layers from current image and content image - **Style loss** is computed between current image and style image in a clever way using Gram matrices (more details in the [example notebook](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/4-ComputerVision/10-GANs/StyleTransfer.ipynb)) * To make the image smoother and remove noise, we also introduce **Variation loss**, which computes average distance between neighboring pixels * The main optimization loop adjusts current image using gradient descent (or some other optimization algorithm) to minimize the total loss, which is a weighted sum of all three losses. ## ✍️ Example: [Style Transfer](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/4-ComputerVision/10-GANs/StyleTransfer.ipynb) ## [Post-lecture quiz](https://ff-quizzes.netlify.app/en/ai/quiz/20) ## Conclusion In this lesson, you learned about GANS and how to train them. You also learned about the special challenges that this type of Neural Network can face, and some strategies on how to move past them. ## 🚀 Challenge Run through the [Style Transfer notebook](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/4-ComputerVision/10-GANs/StyleTransfer.ipynb) using your own images. ## Review & Self Study For reference, read more about GANs in these resources: * Marco Pasini, [10 Lessons I Learned Training GANs for one Year](https://towardsdatascience.com/10-lessons-i-learned-training-generative-adversarial-networks-gans-for-a-year-c9071159628) * [StyleGAN](https://en.wikipedia.org/wiki/StyleGAN), a *de facto* GAN architecture to consider * [Creating Generative Art using GANs on Azure ML](https://soshnikov.com/scienceart/creating-generative-art-using-gan-on-azureml/) ## Assignment Revisit one of the two notebooks associated to this lesson and retrain the GAN on your own images. What can you create? --- ## Lesson 4-ComputerVision: Object Detection > 原文:https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/4-ComputerVision/11-ObjectDetection/README.md # Object Detection The image classification models we have dealt with so far took an image and produced a categorical result, such as the class 'number' in a MNIST problem. However, in many cases we do not want just to know that a picture portrays objects - we want to be able to determine their precise location. This is exactly the point of **object detection**. ## [Pre-lecture quiz](https://ff-quizzes.netlify.app/en/ai/quiz/21) ![Object Detection](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/4-ComputerVision/11-ObjectDetection/images/Screen_Shot_2016-11-17_at_11.14.54_AM.png) > Image from [YOLO v2 web site](https://pjreddie.com/darknet/yolov2/) ## A Naive Approach to Object Detection Assuming we wanted to find a cat on a picture, a very naive approach to object detection would be the following: 1. Break the picture down to a number of tiles 2. Run image classification on each tile. 3. Those tiles that result in sufficiently high activation can be considered to contain the object in question. ![Naive Object Detection](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/4-ComputerVision/11-ObjectDetection/images/naive-detection.png) > *Image from [Exercise Notebook](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/4-ComputerVision/11-ObjectDetection/ObjectDetection-TF.ipynb)* However, this approach is far from ideal, because it only allows the algorithm to locate the object's bounding box very imprecisely. For more precise location, we need to run some sort of **regression** to predict the coordinates of bounding boxes - and for that, we need specific datasets. ## Regression for Object Detection [This blog post](https://towardsdatascience.com/object-detection-with-neural-networks-a4e2c46b4491) has a great gentle introduction to detecting shapes. ## Datasets for Object Detection You might run across the following datasets for this task: * [PASCAL VOC](http://host.robots.ox.ac.uk/pascal/VOC/) - 20 classes * [COCO](http://cocodataset.org/#home) - Common Objects in Context. 80 classes, bounding boxes and segmentation masks ![COCO](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/4-ComputerVision/11-ObjectDetection/images/coco-examples.jpg) ## Object Detection Metrics ### Intersection over Union While for image classification it is easy to measure how well the algorithm performs, for object detection we need to measure both the correctness of the class, as well as the precision of the inferred bounding box location. For the latter, we use the so-called **Intersection over Union** (IoU), which measures how well two boxes (or two arbitrary areas) overlap. ![IoU](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/4-ComputerVision/11-ObjectDetection/images/iou_equation.png) > *Figure 2 from [this excellent blog post on IoU](https://pyimagesearch.com/2016/11/07/intersection-over-union-iou-for-object-detection/)* The idea is simple - we divide the area of intersection between two figures by the area of their union. For two identical areas, IoU would be 1, while for completely disjointed areas it will be 0. Otherwise it will vary from 0 to 1. We typically only consider those bounding boxes for which IoU is over a certain value. ### Average Precision Suppose we want to measure how well a given class of objects $C$ is recognized. To measure it, we use **Average Precision** metrics, which is calculated as follows: 1. Consider Precision-Recall curve shows the accuracy depending on a detection threshold value (from 0 to 1). 2. Depending on the threshold, we will get more or less objects detected in the image, and different values of precision and recall. 3. The curve will look like this: > *Image from [NeuroWorkshop](http://github.com/shwars/NeuroWorkshop)* The average Precision for a given class $C$ is the area under this curve. More precisely, Recall axis is typically divided into 10 parts, and Precision is averaged over all those points: $$ AP = {1\over11}\sum_{i=0}^{10}\mbox{Precision}(\mbox{Recall}={i\over10}) $$ ### AP and IoU We shall consider only those detections, for which IoU is above a certain value. For example, in PASCAL VOC dataset typically $\mbox{IoU Threshold} = 0.5$ is assumed, while in COCO AP is measured for different values of $\mbox{IoU Threshold}$. > *Image from [NeuroWorkshop](http://github.com/shwars/NeuroWorkshop)* ### Mean Average Precision - mAP The main metric for Object Detection is called **Mean Average Precision**, or **mAP**. It is the value of Average Precision, average across all object classes, and sometimes also over $\mbox{IoU Threshold}$. In more detail, the process of calculating **mAP** is described [in this blog post](https://medium.com/@timothycarlen/understanding-the-map-evaluation-metric-for-object-detection-a07fe6962cf3)), and also [here with code samples](https://gist.github.com/tarlen5/008809c3decf19313de216b9208f3734). ## Different Object Detection Approaches There are two broad classes of object detection algorithms: * **Region Proposal Networks** (R-CNN, Fast R-CNN, Faster R-CNN). The main idea is to generate **Regions of Interests** (ROI) and run CNN over them, looking for maximum activation. It is a bit similar to the naive approach, with the exception that ROIs are generated in a more clever way. One of the majors drawbacks of such methods is that they are slow, because we need many passes of the CNN classifier over the image. * **One-pass** (YOLO, SSD, RetinaNet) methods. In those architectures we design the network to predict both classes and ROIs in one pass. ### R-CNN: Region-Based CNN [R-CNN](http://islab.ulsan.ac.kr/files/announcement/513/rcnn_pami.pdf) uses [Selective Search](http://www.huppelen.nl/publications/selectiveSearchDraft.pdf) to generate hierarchical structure of ROI regions, which are then passed through CNN feature extractors and SVM-classifiers to determine the object class, and linear regression to determine *bounding box* coordinates. [Official Paper](https://arxiv.org/pdf/1506.01497v1.pdf) ![RCNN](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/4-ComputerVision/11-ObjectDetection/images/rcnn1.png) > *Image from van de Sande et al. ICCV’11* ![RCNN-1](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/4-ComputerVision/11-ObjectDetection/images/rcnn2.png) > *Images from [this blog](https://towardsdatascience.com/r-cnn-fast-r-cnn-faster-r-cnn-yolo-object-detection-algorithms-36d53571365e) ### F-RCNN - Fast R-CNN This approach is similar to R-CNN, but regions are defined after convolution layers have been applied. ![FRCNN](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/4-ComputerVision/11-ObjectDetection/images/f-rcnn.png) > Image from [the Official Paper](https://www.cv-foundation.org/openaccess/content_iccv_2015/papers/Girshick_Fast_R-CNN_ICCV_2015_paper.pdf), [arXiv](https://arxiv.org/pdf/1504.08083.pdf), 2015 ### Faster R-CNN The main idea of this approach is to use neural network to predict ROIs - so-called *Region Proposal Network*. [Paper](https://arxiv.org/pdf/1506.01497.pdf), 2016 ![FasterRCNN](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/4-ComputerVision/11-ObjectDetection/images/faster-rcnn.png) > Image from [the official paper](https://arxiv.org/pdf/1506.01497.pdf) ### R-FCN: Region-Based Fully Convolutional Network This algorithm is even faster than Faster R-CNN. The main idea is the following: 1. We extract features using ResNet-101 1. Features are processed by **Position-Sensitive Score Map**. Each object from $C$ classes is divided by $k\times k$ regions, and we are training to predict parts of objects. 1. For each part from $k\times k$ regions all networks vote for object classes, and the object class with maximum vote is selected. ![r-fcn image](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/4-ComputerVision/11-ObjectDetection/images/r-fcn.png) > Image from [official paper](https://arxiv.org/abs/1605.06409) ### YOLO - You Only Look Once YOLO is a realtime one-pass algorithm. The main idea is the following: * Image is divided into $S\times S$ regions * For each region, **CNN** predicts $n$ possible objects, *bounding box* coordinates and *confidence*=*probability* * IoU. ![YOLO](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/4-ComputerVision/11-ObjectDetection/images/yolo.png) > Image from [official paper](https://arxiv.org/abs/1506.02640) ### Other Algorithms * RetinaNet: [official paper](https://arxiv.org/abs/1708.02002) - [PyTorch Implementation in Torchvision](https://pytorch.org/vision/stable/_modules/torchvision/models/detection/retinanet.html) - [Keras Implementation](https://github.com/fizyr/keras-retinanet) - [Object Detection with RetinaNet](https://keras.io/examples/vision/retinanet/) in Keras Samples * SSD (Single Shot Detector): [official paper](https://arxiv.org/abs/1512.02325) ## ✍️ Exercises: Object Detection Continue your learning in the following notebook: [ObjectDetection.ipynb](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/4-ComputerVision/11-ObjectDetection/ObjectDetection.ipynb) ## Conclusion In this lesson you took a whirlwind tour of all the various ways that object detection can be accomplished! ## 🚀 Challenge Read through these articles and notebooks about YOLO and try them for yourself * [Good blog post](https://www.analyticsvidhya.com/blog/2018/12/practical-guide-object-detection-yolo-framewor-python/) describing YOLO * [Official site](https://pjreddie.com/darknet/yolo/) * Yolo: [Keras implementation](https://github.com/experiencor/keras-yolo2), [step-by-step notebook](https://github.com/experiencor/basic-yolo-keras/blob/master/Yolo%20Step-by-Step.ipynb) * Yolo v2: [Keras implementation](https://github.com/experiencor/keras-yolo2), [step-by-step notebook](https://github.com/experiencor/keras-yolo2/blob/master/Yolo%20Step-by-Step.ipynb) ## [Post-lecture quiz](https://ff-quizzes.netlify.app/en/ai/quiz/22) ## Review & Self Study * [Object Detection](https://tjmachinelearning.com/lectures/1718/obj/) by Nikhil Sardana * [A good comparison of object detection algorithms](https://lilianweng.github.io/lil-log/2018/12/27/object-detection-part-4.html) * [Review of Deep Learning Algorithms for Object Detection](https://medium.com/comet-app/review-of-deep-learning-algorithms-for-object-detection-c1f3d437b852) * [A Step-by-Step Introduction to the Basic Object Detection Algorithms](https://www.analyticsvidhya.com/blog/2018/10/a-step-by-step-introduction-to-the-basic-object-detection-algorithms-part-1/) * [Implementation of Faster R-CNN in Python for Object Detection](https://www.analyticsvidhya.com/blog/2018/11/implementation-faster-r-cnn-python-object-detection/) ## [Assignment: Object Detection](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/4-ComputerVision/11-ObjectDetection/lab/README.md) --- ## Lesson 4-ComputerVision: Segmentation > 原文:https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/4-ComputerVision/12-Segmentation/README.md # Segmentation We have previously learned about Object Detection, which allows us to locate objects in the image by predicting their *bounding boxes*. However, for some tasks we do not only need bounding boxes, but also more precise object localization. This task is called **segmentation**. ## [Pre-lecture quiz](https://ff-quizzes.netlify.app/en/ai/quiz/23) Segmentation can be viewed as **pixel classification**, whereas for **each** pixel of image we must predict its class (*background* being one of the classes). There are two main segmentation algorithms: * **Semantic segmentation** only tells the pixel class, and does not make a distinction between different objects of the same class * **Instance segmentation** divides classes into different instances. For instance segmentation, these sheep are different objects, but for semantic segmentation all sheep are represented by one class. > Image from [this blog post](https://nirmalamurali.medium.com/image-classification-vs-semantic-segmentation-vs-instance-segmentation-625c33a08d50) There are different neural architectures for segmentation, but they all have the same structure. In a way, it is similar to the autoencoder you learned about previously, but instead of deconstructing the original image, our goal is to deconstruct a **mask**. Thus, a segmentation network has the following parts: * **Encoder** extracts features from input image * **Decoder** transforms those features into the **mask image**, with the same size and number of channels corresponding to the number of classes. > Image from [this publication](https://arxiv.org/pdf/2001.05566.pdf) We should especially mention the loss function that is used for segmentation. When using classical autoencoders, we need to measure the similarity between two images, and we can use mean square error (MSE) to do that. In segmentation, each pixel in the target mask image represents the class number (one-hot-encoded along the third dimension), so we need to use loss functions specific for classification - cross-entropy loss, averaged over all pixels. If the mask is binary - **binary cross-entropy loss** (BCE) is used. > ✅ One-hot encoding is a way to encode a class label into a vector of length equal to the number of classes. Take a look at [this article](https://datagy.io/sklearn-one-hot-encode/) on this technique. ## Segmentation for Medical Imaging In this lesson, we will see the segmentation in action by training the network to recognize human nevi (also known as moles) on medical images. We will be using PH2 Database of dermoscopy images as the image source. This dataset contains 200 images of three classes: typical nevus, atypical nevus, and melanoma. All images also contain a corresponding **mask** that outlines the nevus. > ✅ This technique is particularly appropriate for this type of medical imaging, but what other real-world applications could you envision? navi > Image from the PH2 Database We will train a model to segment any nevus from its background. ## ✍️ Exercises: Semantic Segmentation Open the notebooks below to learn more about different semantic segmentation architectures, practice working with them, and see them in action. * [Semantic Segmentation Pytorch](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/4-ComputerVision/12-Segmentation/SemanticSegmentationPytorch.ipynb) * [Semantic Segmentation TensorFlow](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/4-ComputerVision/12-Segmentation/SemanticSegmentationTF.ipynb) ## [Post-lecture quiz](https://ff-quizzes.netlify.app/en/ai/quiz/24) ## Conclusion Segmentation is a very powerful technique for image classification, moving beyond bounding boxes to pixel-level classification. It is a technique used in medical imaging, among other applications. ## 🚀 Challenge Body segmentation is just one of the common tasks that we can do with images of people. Another important tasks include **skeleton detection** and **pose detection**. Try out [OpenPose](https://github.com/CMU-Perceptual-Computing-Lab/openpose) library to see how pose detection can be used. ## Review & Self Study This [wikipedia article](https://wikipedia.org/wiki/Image_segmentation) offers a good overview of the various applications of this technique. Learn more on your own about the subdomains of Instance segmentation and Panoptic segmentation in this field of inquiry. ## [Assignment](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/4-ComputerVision/12-Segmentation/lab/README.md) In this lab, try **human body segmentation** using [Segmentation Full Body MADS Dataset](https://www.kaggle.com/datasets/tapakah68/segmentation-full-body-mads-dataset) from Kaggle. --- ## Lesson 5-NLP: Representing Text as Tensors > 原文:https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/5-NLP/13-TextRep/README.md # Representing Text as Tensors ## [Pre-lecture quiz](https://ff-quizzes.netlify.app/en/ai/quiz/25) ## Text Classification Throughout the first part of this section, we will focus on **text classification** task. We will use the [AG News](https://www.kaggle.com/amananandrai/ag-news-classification-dataset) Dataset, which contains news articles like the following: * Category: Sci/Tech * Title: Ky. Company Wins Grant to Study Peptides (AP) * Body: AP - A company founded by a chemistry researcher at the University of Louisville won a grant to develop... Our goal will be to classify the news item into one of the categories based on text. ## Representing text If we want to solve Natural Language Processing (NLP) tasks with neural networks, we need some way to represent text as tensors. Computers already represent textual characters as numbers that map to fonts on your screen using encodings such as ASCII or UTF-8. Image showing diagram mapping a character to an ASCII and binary representation > [Image source](https://www.seobility.net/en/wiki/ASCII) As humans, we understand what each letter **represents**, and how all characters come together to form the words of a sentence. However, computers by themselves do not have such an understanding, and neural network has to learn the meaning during training. Therefore, we can use different approaches when representing text: * **Character-level representation**, when we represent text by treating each character as a number. Given that we have *C* different characters in our text corpus, the word *Hello* would be represented by 5x*C* tensor. Each letter would correspond to a tensor column in one-hot encoding. * **Word-level representation**, in which we create a **vocabulary** of all words in our text, and then represent words using one-hot encoding. This approach is somehow better, because each letter by itself does not have much meaning, and thus by using higher-level semantic concepts - words - we simplify the task for the neural network. However, given the large dictionary size, we need to deal with high-dimensional sparse tensors. Regardless of the representation, we first need to convert the text into a sequence of **tokens**, one token being either a character, a word, or sometimes even part of a word. Then, we convert the token into a number, typically using **vocabulary**, and this number can be fed into a neural network using one-hot encoding. ## N-Grams In natural language, precise meaning of words can only be determined in context. For example, meanings of *neural network* and *fishing network* are completely different. One of the ways to take this into account is to build our model on pairs of words, and considering word pairs as separate vocabulary tokens. In this way, the sentence *I like to go fishing* will be represented by the following sequence of tokens: *I like*, *like to*, *to go*, *go fishing*. The problem with this approach is that the dictionary size grows significantly, and combinations like *go fishing* and *go shopping* are presented by different tokens, which do not share any semantic similarity despite the same verb. In some cases, we may consider using tri-grams -- combinations of three words -- as well. Thus the approach is such is often called **n-grams**. Also, it makes sense to use n-grams with character-level representation, in which case n-grams will roughly correspond to different syllabi. ## Bag-of-Words and TF/IDF When solving tasks like text classification, we need to be able to represent text by one fixed-size vector, which we will use as an input to final dense classifier. One of the simplest ways to do that is to combine all individual word representations, eg. by adding them. If we add one-hot encodings of each word, we will end up with a vector of frequencies, showing how many times each word appears inside the text. Such representation of text is called **bag of words** (BoW). > Image by the author A BoW essentially represents which words appear in text and in which quantities, which can indeed be a good indication of what the text is about. For example, news article on politics is likely to contains words such as *president* and *country*, while scientific publication would have something like *collider*, *discovered*, etc. Thus, word frequencies can in many cases be a good indicator of text content. The problem with BoW is that certain common words, such as *and*, *is*, etc. appear in most of the texts, and they have highest frequencies, masking out the words that are really important. We may lower the importance of those words by taking into account the frequency at which words occur in the whole document collection. This is the main idea behind TF/IDF approach, which is covered in more detail in the notebooks attached to this lesson. However, none of those approaches can fully take into account the **semantics** of text. We need more powerful neural networks models to do this, which we will discuss later in this section. ## ✍️ Exercises: Text Representation Continue your learning in the following notebooks: * [Text Representation with PyTorch](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/5-NLP/13-TextRep/TextRepresentationPyTorch.ipynb) * [Text Representation with TensorFlow](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/5-NLP/13-TextRep/TextRepresentationTF.ipynb) ## Conclusion So far, we have studied techniques that can add frequency weight to different words. They are, however, unable to represent meaning or order. As the famous linguist J. R. Firth said in 1935, "The complete meaning of a word is always contextual, and no study of meaning apart from context can be taken seriously." We will learn later in the course how to capture contextual information from text using language modeling. ## 🚀 Challenge Try some other exercises using bag-of-words and different data models. You might be inspired by this [competition on Kaggle](https://www.kaggle.com/competitions/word2vec-nlp-tutorial/overview/part-1-for-beginners-bag-of-words) ## [Post-lecture quiz](https://ff-quizzes.netlify.app/en/ai/quiz/26) ## Review & Self Study Practice your skills with text embeddings and bag-of-words techniques on [Microsoft Learn](https://docs.microsoft.com/learn/modules/intro-natural-language-processing-pytorch/?WT.mc_id=academic-77998-cacaste) ## [Assignment: Notebooks](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/5-NLP/13-TextRep/assignment.md) --- ## Lesson 5-NLP: Embeddings > 原文:https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/5-NLP/14-Embeddings/README.md # Embeddings ## [Pre-lecture quiz](https://ff-quizzes.netlify.app/en/ai/quiz/27) When training classifiers based on BoW or TF/IDF, we operated on high-dimensional bag-of-words vectors with length `vocab_size`, and we were explicitly converting from low-dimensional positional representation vectors into sparse one-hot representation. This one-hot representation, however, is not memory-efficient. In addition, each word is treated independently from each other, i.e. one-hot encoded vectors do not express any semantic similarity between words. The idea of **embedding** is to represent words by lower-dimensional dense vectors, which somehow reflect the semantic meaning of a word. We will later discuss how to build meaningful word embeddings, but for now let's just think of embeddings as a way to lower dimensionality of a word vector. So, the embedding layer would take a word as an input, and produce an output vector of specified `embedding_size`. In a sense, it is very similar to a `Linear` layer, but instead of taking a one-hot encoded vector, it will be able to take a word number as an input, allowing us to avoid creating large one-hot-encoded vectors. By using an embedding layer as a first layer in our classifier network, we can switch from a bag-of-words to **embedding bag** model, where we first convert each word in our text into corresponding embedding, and then compute some aggregate function over all those embeddings, such as `sum`, `average` or `max`. ![Image showing an embedding classifier for five sequence words.](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/5-NLP/14-Embeddings/images/embedding-classifier-example.png) > Image by the author ## ✍️ Exercises: Embeddings Continue your learning in the following notebooks: * [Embeddings with PyTorch](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/5-NLP/14-Embeddings/EmbeddingsPyTorch.ipynb) * [Embeddings TensorFlow](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/5-NLP/14-Embeddings/EmbeddingsTF.ipynb) ## Semantic Embeddings: Word2Vec While the embedding layer learned to map words to vector representation, however, this representation did not necessarily have much semantical meaning. It would be nice to learn a vector representation such that similar words or synonyms correspond to vectors that are close to each other in terms of some vector distance (eg. Euclidean distance). To do that, we need to pre-train our embedding model on a large collection of text in a specific way. One way to train semantic embeddings is called [Word2Vec](https://en.wikipedia.org/wiki/Word2vec). It is based on two main architectures that are used to produce a distributed representation of words: - **Continuous bag-of-words** (CBoW) — in this architecture, we train the model to predict a word from surrounding context. Given the ngram $(W_{-2},W_{-1},W_0,W_1,W_2)$, the goal of the model is to predict $W_0$ from $(W_{-2},W_{-1},W_1,W_2)$. - **Continuous skip-gram** is opposite to CBoW. The model uses surrounding window of context words to predict the current word. CBoW is faster, while skip-gram is slower, but does a better job of representing infrequent words. ![Image showing both CBoW and Skip-Gram algorithms to convert words to vectors.](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/5-NLP/14-Embeddings/images/example-algorithms-for-converting-words-to-vectors.png) > Image from [this paper](https://arxiv.org/pdf/1301.3781.pdf) Word2Vec pre-trained embeddings (as well as other similar models, such as GloVe) can also be used in place of embedding layer in neural networks. However, we need to deal with vocabularies, because the vocabulary used to pre-train Word2Vec/GloVe is likely to differ from the vocabulary in our text corpus. Have a look into the above Notebooks to see how this problem can be resolved. ## Contextual Embeddings One key limitation of traditional pretrained embedding representations such as Word2Vec is the problem of word sense disambiguation. While pretrained embeddings can capture some of the meaning of words in context, every possible meaning of a word is encoded into the same embedding. This can cause problems in downstream models, since many words such as the word 'play' have different meanings depending on the context they are used in. For example word 'play' in those two different sentences have quite different meaning: - I went to a **play** at the theatre. - John wants to **play** with his friends. The pretrained embeddings above represent both of these meanings of the word 'play' in the same embedding. To overcome this limitation, we need to build embeddings based on the **language model**, which is trained on a large corpus of text, and *knows* how words can be put together in different contexts. Discussing contextual embeddings is out of scope for this tutorial, but we will come back to them when talking about language models later in the course. ## Conclusion In this lesson, you discovered how to build and use embedding layers in TensorFlow and Pytorch to better reflect the semantic meanings of words. ## 🚀 Challenge Word2Vec has been used for some interesting applications, including generating song lyrics and poetry. Take a look at [this article](https://www.politetype.com/blog/word2vec-color-poems) which walks through how the author used Word2Vec to generate poetry. Watch [this video by Dan Shiffmann](https://www.youtube.com/watch?v=LSS_bos_TPI&ab_channel=TheCodingTrain) as well to discover a different explanation of this technique. Then try to apply these techniques to your own text corpus, perhaps sourced from Kaggle. ## [Post-lecture quiz](https://ff-quizzes.netlify.app/en/ai/quiz/28) ## Review & Self Study Read through this paper on Word2Vec: [Efficient Estimation of Word Representations in Vector Space](https://arxiv.org/pdf/1301.3781.pdf) ## [Assignment: Notebooks](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/5-NLP/14-Embeddings/assignment.md) --- ## Lesson 5-NLP: Language Modeling > 原文:https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/5-NLP/15-LanguageModeling/README.md # Language Modeling Semantic embeddings, such as Word2Vec and GloVe, are in fact a first step towards **language modeling** - creating models that somehow *understand* (or *represent*) the nature of the language. ## [Pre-lecture quiz](https://ff-quizzes.netlify.app/en/ai/quiz/29) The main idea behind language modeling is training them on unlabeled datasets in an unsupervised manner. This is important because we have huge amounts of unlabeled text available, while the amount of labeled text would always be limited by the amount of effort we can spend on labeling. Most often, we can build language models that can **predict missing words** in the text, because it is easy to mask out a random word in text and use it as a training sample. ## Training Embeddings In our previous examples, we used pre-trained semantic embeddings, but it is interesting to see how those embeddings can be trained. There are several possible ideas the can be used: * **N-Gram** language modeling, when we predict a token by looking at N previous tokens (N-gram) * **Continuous Bag-of-Words** (CBoW), when we predict the middle token $W_0$ in a token sequence $W_{-N}$, ..., $W_N$. * **Skip-gram**, where we predict a set of neighboring tokens {$W_{-N},\dots, W_{-1}, W_1,\dots, W_N$} from the middle token $W_0$. ![image from paper on converting words to vectors](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/5-NLP/14-Embeddings/images/example-algorithms-for-converting-words-to-vectors.png) > Image from [this paper](https://arxiv.org/pdf/1301.3781.pdf) ## ✍️ Example Notebooks: Training CBoW model Continue your learning in the following notebooks: * [Training CBoW Word2Vec with TensorFlow](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/5-NLP/15-LanguageModeling/CBoW-TF.ipynb) * [Training CBoW Word2Vec with PyTorch](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/5-NLP/15-LanguageModeling/CBoW-PyTorch.ipynb) ## Conclusion In the previous lesson we have seen that words embeddings work like magic! Now we know that training word embeddings is not a very complex task, and we should be able to train our own word embeddings for domain specific text if needed. ## [Post-lecture quiz](https://ff-quizzes.netlify.app/en/ai/quiz/30) ## Review & Self Study * [Official PyTorch tutorial on Language Modeling](https://pytorch.org/tutorials/beginner/nlp/word_embeddings_tutorial.html). * [Official TensorFlow tutorial on training Word2Vec model](https://www.TensorFlow.org/tutorials/text/word2vec). * Using the **gensim** framework to train most commonly used embeddings in a few lines of code is described [in this documentation](https://pytorch.org/tutorials/beginner/nlp/word_embeddings_tutorial.html). ## 🚀 [Assignment: Train Skip-Gram Model](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/5-NLP/15-LanguageModeling/lab/README.md) In the lab, we challenge you to modify the code from this lesson to train skip-gram model instead of CBoW. [Read the details](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/5-NLP/15-LanguageModeling/lab/README.md) --- ## Lesson 5-NLP: Recurrent Neural Networks > 原文:https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/5-NLP/16-RNN/README.md # Recurrent Neural Networks ## [Pre-lecture quiz](https://ff-quizzes.netlify.app/en/ai/quiz/31) In previous sections, we have been using rich semantic representations of text and a simple linear classifier on top of the embeddings. What this architecture does is to capture the aggregated meaning of words in a sentence, but it does not take into account the **order** of words, because the aggregation operation on top of embeddings removed this information from the original text. Because these models are unable to model word ordering, they cannot solve more complex or ambiguous tasks such as text generation or question answering. To capture the meaning of text sequence, we need to use another neural network architecture, which is called a **recurrent neural network**, or RNN. In RNN, we pass our sentence through the network one symbol at a time, and the network produces some **state**, which we then pass to the network again with the next symbol. ![RNN](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/5-NLP/16-RNN/images/rnn.png) > Image by the author Given the input sequence of tokens X0,...,Xn, RNN creates a sequence of neural network blocks, and trains this sequence end-to-end using backpropagation. Each network block takes a pair (Xi,Si) as an input, and produces Si+1 as a result. The final state Sn or (output Yn) goes into a linear classifier to produce the result. All the network blocks share the same weights, and are trained end-to-end using one backpropagation pass. Because state vectors S0,...,Sn are passed through the network, it is able to learn the sequential dependencies between words. For example, when the word *not* appears somewhere in the sequence, it can learn to negate certain elements within the state vector, resulting in negation. > ✅ Since the weights of all RNN blocks on the picture above are shared, the same picture can be represented as one block (on the right) with a recurrent feedback loop, which passes the output state of the network back to the input. ## Anatomy of an RNN Cell Let's see how a simple RNN cell is organized. It accepts the previous state Si-1 and current symbol Xi as inputs, and has to produce the output state Si (and, sometimes, we are also interested in some other output Yi, as in the case with generative networks). A simple RNN cell has two weight matrices inside: one transforms an input symbol (let's call it W), and another one transforms an input state (H). In this case the output of the network is calculated as σ(W×Xi+H×Si-1+b), where σ is the activation function and b is additional bias. RNN Cell Anatomy > Image by the author In many cases, input tokens are passed through the embedding layer before entering the RNN to lower the dimensionality. In this case, if the dimension of the input vectors is *emb_size*, and state vector is *hid_size* - the size of W is *emb_size*×*hid_size*, and the size of H is *hid_size*×*hid_size*. ## Long Short Term Memory (LSTM) One of the main problems of classical RNNs is the so-called **vanishing gradients** problem. Because RNNs are trained end-to-end in one backpropagation pass, it has difficulty propagating error to the first layers of the network, and thus the network cannot learn relationships between distant tokens. One of the ways to avoid this problem is to introduce **explicit state management** by using so called **gates**. There are two well-known architectures of this kind: **Long Short Term Memory** (LSTM) and **Gated Relay Unit** (GRU). ![Image showing an example long short term memory cell](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/5-NLP/16-RNN/images/long-short-term-memory-cell.svg) > Image source TBD The LSTM Network is organized in a manner similar to RNN, but there are two states that are being passed from layer to layer: the actual state C, and the hidden vector H. At each unit, the hidden vector Hi is concatenated with input Xi, and they control what happens to the state C via **gates**. Each gate is a neural network with sigmoid activation (output in the range [0,1]), which can be thought of as a bitwise mask when multiplied by the state vector. There are the following gates (from left to right on the picture above): * The **forget gate** takes a hidden vector and determines which components of the vector C we need to forget, and which to pass through. * The **input gate** takes some information from the input and hidden vectors and inserts it into state. * The **output gate** transforms state via a linear layer with *tanh* activation, then selects some of its components using a hidden vector Hi to produce a new state Ci+1. Components of the state C can be thought of as some flags that can be switched on and off. For example, when we encounter a name *Alice* in the sequence, we may want to assume that it refers to a female character, and raise the flag in the state that we have a female noun in the sentence. When we further encounter phrases *and Tom*, we will raise the flag that we have a plural noun. Thus by manipulating state we can supposedly keep track of the grammatical properties of sentence parts. > ✅ An excellent resource for understanding the internals of LSTM is this great article [Understanding LSTM Networks](https://colah.github.io/posts/2015-08-Understanding-LSTMs/) by Christopher Olah. ## Bidirectional and Multilayer RNNs We have discussed recurrent networks that operate in one direction, from beginning of a sequence to the end. It looks natural, because it resembles the way we read and listen to speech. However, since in many practical cases we have random access to the input sequence, it might make sense to run recurrent computation in both directions. Such networks are call **bidirectional** RNNs. When dealing with bidirectional network, we would need two hidden state vectors, one for each direction. A Recurrent network, either one-directional or bidirectional, captures certain patterns within a sequence, and can store them into a state vector or pass into output. As with convolutional networks, we can build another recurrent layer on top of the first one to capture higher level patterns and build from low-level patterns extracted by the first layer. This leads us to the notion of a **multi-layer RNN** which consists of two or more recurrent networks, where the output of the previous layer is passed to the next layer as input. ![Image showing a Multilayer long-short-term-memory- RNN](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/5-NLP/16-RNN/images/multi-layer-lstm.jpg) *Picture from [this wonderful post](https://towardsdatascience.com/from-a-lstm-cell-to-a-multilayer-lstm-network-with-pytorch-2899eb5696f3) by Fernando López* ## ✍️ Exercises: Embeddings Continue your learning in the following notebooks: * [RNNs with PyTorch](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/5-NLP/16-RNN/RNNPyTorch.ipynb) * [RNNs with TensorFlow](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/5-NLP/16-RNN/RNNTF.ipynb) ## Conclusion In this unit, we have seen that RNNs can be used for sequence classification, but in fact, they can handle many more tasks, such as text generation, machine translation, and more. We will consider those tasks in the next unit. ## 🚀 Challenge Read through some literature about LSTMs and consider their applications: - [Grid Long Short-Term Memory](https://arxiv.org/pdf/1507.01526v1.pdf) - [Show, Attend and Tell: Neural Image Caption Generation with Visual Attention](https://arxiv.org/pdf/1502.03044v2.pdf) ## [Post-lecture quiz](https://ff-quizzes.netlify.app/en/ai/quiz/32) ## Review & Self Study - [Understanding LSTM Networks](https://colah.github.io/posts/2015-08-Understanding-LSTMs/) by Christopher Olah. ## [Assignment: Notebooks](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/5-NLP/16-RNN/assignment.md) --- ## Lesson 5-NLP: Generative networks > 原文:https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/5-NLP/17-GenerativeNetworks/README.md # Generative networks ## [Pre-lecture quiz](https://ff-quizzes.netlify.app/en/ai/quiz/33) Recurrent Neural Networks (RNNs) and their gated cell variants such as Long Short Term Memory Cells (LSTMs) and Gated Recurrent Units (GRUs) provided a mechanism for language modeling in that they can learn word ordering and provide predictions for the next word in a sequence. This allows us to use RNNs for **generative tasks**, such as ordinary text generation, machine translation, and even image captioning. > ✅ Think about all the times you've benefited from generative tasks such as text completion as you type. Do some research into your favorite applications to see if they leveraged RNNs. In RNN architecture we discussed in the previous unit, each RNN unit produced the next hidden state as an output. However, we can also add another output to each recurrent unit, which would allow us to output a **sequence** (which is equal in length to the original sequence). Moreover, we can use RNN units that do not accept an input at each step, and just take some initial state vector, and then produce a sequence of outputs. This allows for different neural architectures that are shown in the picture below: ![Image showing common recurrent neural network patterns.](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/5-NLP/17-GenerativeNetworks/images/unreasonable-effectiveness-of-rnn.jpg) > Image from blog post [Unreasonable Effectiveness of Recurrent Neural Networks](http://karpathy.github.io/2015/05/21/rnn-effectiveness/) by [Andrej Karpaty](http://karpathy.github.io/) * **One-to-one** is a traditional neural network with one input and one output * **One-to-many** is a generative architecture that accepts one input value, and generates a sequence of output values. For example, if we want to train an **image captioning** network that would produce a textual description of a picture, we can a picture as input, pass it through a CNN to obtain its hidden state, and then have a recurrent chain generate caption word-by-word * **Many-to-one** corresponds to the RNN architectures we described in the previous unit, such as text classification * **Many-to-many**, or **sequence-to-sequence** corresponds to tasks such as **machine translation**, where we have first RNN collect all information from the input sequence into the hidden state, and another RNN chain unrolls this state into the output sequence. In this unit, we will focus on simple generative models that help us generate text. For simplicity, we will use character-level tokenization. We will train this RNN to generate text step by step. On each step, we will take a sequence of characters of length `nchars`, and ask the network to generate the next output character for each input character: ![Image showing an example RNN generation of the word 'HELLO'.](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/5-NLP/17-GenerativeNetworks/images/rnn-generate.png) When generating text (during inference), we start with some **prompt**, which is passed through RNN cells to generate its intermediate state, and then from this state the generation starts. We generate one character at a time, and pass the state and the generated character to another RNN cell to generate the next one, until we generate enough characters. > Image by the author ## ✍️ Exercises: Generative Networks Continue your learning in the following notebooks: * [Generative Networks with PyTorch](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/5-NLP/17-GenerativeNetworks/GenerativePyTorch.ipynb) * [Generative Networks with TensorFlow](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/5-NLP/17-GenerativeNetworks/GenerativeTF.ipynb) ## Soft text generation and temperature The output of each RNN cell is a probability distribution of characters. If we always take the character with the highest probability as the next character in generated text, the text often can become "cycled" between the same character sequences again and again, like in this example: ``` today of the second the company and a second the company ... ``` However, if we look at the probability distribution for the next character, it could be that the difference between a few highest probabilities is not huge, e.g. one character can have probability 0.2, another - 0.19, etc. For example, when looking for the next character in the sequence '*play*', next character can equally well be either space, or **e** (as in the word *player*). This leads us to the conclusion that it is not always "fair" to select the character with a higher probability, because choosing the second highest might still lead us to meaningful text. It is more wise to **sample** characters from the probability distribution given by the network output. We can also use a parameter, **temperature**, that will flatten out the probability distribution, in case we want to add more randomness, or make it more steep, if we want to stick more to the highest-probability characters. Explore how this soft text generation is implemented in the notebooks linked above. ## Conclusion While text generation may be useful in its own right, the major benefits come from the ability to generate text using RNNs from some initial feature vector. For example, text generation is used as part of machine translation (sequence-to-sequence, in this case state vector from *encoder* is used to generate or *decode* translated message), or generating textual description of an image (in which case the feature vector would come from CNN extractor). ## 🚀 Challenge Take some lessons on Microsoft Learn on this topic * Text Generation with [PyTorch](https://docs.microsoft.com/learn/modules/intro-natural-language-processing-pytorch/6-generative-networks/?WT.mc_id=academic-77998-cacaste)/[TensorFlow](https://docs.microsoft.com/learn/modules/intro-natural-language-processing-tensorflow/5-generative-networks/?WT.mc_id=academic-77998-cacaste) ## [Post-lecture quiz](https://ff-quizzes.netlify.app/en/ai/quiz/34) ## Review & Self Study Here are some articles to expand your knowledge * Different approaches to text generation with Markov Chain, LSTM and GPT-2: [blog post](https://towardsdatascience.com/text-generation-gpt-2-lstm-markov-chain-9ea371820e1e) * Text generation sample in [Keras documentation](https://keras.io/examples/generative/lstm_character_level_text_generation/) ## [Assignment](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/5-NLP/17-GenerativeNetworks/lab/README.md) We have seen how to generate text character-by-character. In the lab, you will explore word-level text generation. --- ## Lesson 5-NLP: Attention Mechanisms and Transformers > 原文:https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/5-NLP/18-Transformers/README.md # Attention Mechanisms and Transformers ## [Pre-lecture quiz](https://ff-quizzes.netlify.app/en/ai/quiz/35) One of the most important problems in the NLP domain is **machine translation**, an essential task that underlies tools such as Google Translate. In this section, we will focus on machine translation, or, more generally, on any *sequence-to-sequence* task (which is also called **sentence transduction**). With RNNs, sequence-to-sequence is implemented by two recurrent networks, where one network, the **encoder**, collapses an input sequence into a hidden state, while another network, the **decoder**, unrolls this hidden state into a translated result. There are a couple of problems with this approach: * The final state of the encoder network has a hard time remembering the beginning of a sentence, thus causing poor quality of the model for long sentences * All words in a sequence have the same impact on the result. In reality, however, specific words in the input sequence often have more impact on sequential outputs than others. **Attention Mechanisms** provide a means of weighting the contextual impact of each input vector on each output prediction of the RNN. The way it is implemented is by creating shortcuts between intermediate states of the input RNN and the output RNN. In this manner, when generating output symbol yt, we will take into account all input hidden states hi, with different weight coefficients αt,i. ![Image showing an encoder/decoder model with an additive attention layer](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/5-NLP/18-Transformers/images/encoder-decoder-attention.png) > The encoder-decoder model with additive attention mechanism in [Bahdanau et al., 2015](https://arxiv.org/pdf/1409.0473.pdf), cited from [this blog post](https://lilianweng.github.io/lil-log/2018/06/24/attention-attention.html) The attention matrix {αi,j} would represent the degree that certain input words play in the generation of a given word in the output sequence. Below is an example of such a matrix: ![Image showing a sample alignment found by RNNsearch-50, taken from Bahdanau - arviz.org](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/5-NLP/18-Transformers/images/bahdanau-fig3.png) > Figure from [Bahdanau et al., 2015](https://arxiv.org/pdf/1409.0473.pdf) (Fig.3) Attention mechanisms are responsible for much of the current or near current state of the art in NLP. Adding attention however greatly increases the number of model parameters which led to scaling issues with RNNs. A key constraint of scaling RNNs is that the recurrent nature of the models makes it challenging to batch and parallelize training. In an RNN each element of a sequence needs to be processed in sequential order which means it cannot be easily parallelized. ![Encoder Decoder with Attention](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/5-NLP/18-Transformers/images/EncDecAttention.gif) > Figure from [Google's Blog](https://research.googleblog.com/2016/09/a-neural-network-for-machine.html) The adoption of attention mechanisms combined with this constraint led to the creation of the now State of the Art Transformer Models that we know and use today such as BERT to Open-GPT3. ## Transformer models One of the main ideas behind transformers is to avoid sequential nature of RNNs and to create a model that is parallelizable during training. This is achieved by implementing two ideas: * positional encoding * using self-attention mechanism to capture patterns instead of RNNs (or CNNs) (that is why the paper that introduces transformers is called *[Attention is all you need](https://arxiv.org/abs/1706.03762)* ### Positional Encoding/Embedding The idea of positional encoding is the following. 1. When using RNNs, the relative position of the tokens is represented by the number of steps, and thus does not need to be explicitly represented. 2. However, once we switch to attention, we need to know the relative positions of tokens within a sequence. 3. To get positional encoding, we augment our sequence of tokens with a sequence of token positions in the sequence (i.e., a sequence of numbers 0,1, ...). 4. We then mix the token position with a token embedding vector. To transform the position (integer) into a vector, we can use different approaches: * Trainable embedding, similar to token embedding. This is the approach we consider here. We apply embedding layers on top of both tokens and their positions, resulting in embedding vectors of the same dimensions, which we then add together. * Fixed position encoding function, as proposed in the original paper. > Image by the author The result that we get with positional embedding embeds both the original token and its position within a sequence. ### Multi-Head Self-Attention Next, we need to capture some patterns within our sequence. To do this, transformers use a **self-attention** mechanism, which is essentially attention applied to the same sequence as the input and output. Applying self-attention allows us to take into account **context** within the sentence, and see which words are inter-related. For example, it allows us to see which words are referred to by coreferences, such as *it*, and also take the context into account: ![](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/5-NLP/19-NER/images/CoreferenceResolution.png) > Image from the [Google Blog](https://research.googleblog.com/2017/08/transformer-novel-neural-network.html) In transformers, we use **Multi-Head Attention** in order to give the network the power to capture several different types of dependencies, eg. long-term vs. short-term word relations, co-reference vs. something else, etc. [TensorFlow Notebook](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/5-NLP/18-Transformers/TransformersTF.ipynb) contains more detains on the implementation of transformer layers. ### Encoder-Decoder Attention In transformers, attention is used in two places: * To capture patterns within the input text using self-attention * To perform sequence translation - it is the attention layer between encoder and decoder. Encoder-decoder attention is very similar to the attention mechanism used in RNNs, as described in the beginning of this section. This animated diagram explains the role of encoder-decoder attention. ![Animated GIF showing how the evaluations are performed in transformer models.](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/5-NLP/18-Transformers/images/transformer-animated-explanation.gif) Since each input position is mapped independently to each output position, transformers can parallelize better than RNNs, which enables much larger and more expressive language models. Each attention head can be used to learn different relationships between words that improves downstream Natural Language Processing tasks. ## BERT **BERT** (Bidirectional Encoder Representations from Transformers) is a very large multi layer transformer network with 12 layers for *BERT-base*, and 24 for *BERT-large*. The model is first pre-trained on a large corpus of text data (WikiPedia + books) using unsupervised training (predicting masked words in a sentence). During pre-training the model absorbs significant levels of language understanding which can then be leveraged with other datasets using fine tuning. This process is called **transfer learning**. ![picture from http://jalammar.github.io/illustrated-bert/](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/5-NLP/18-Transformers/images/jalammarBERT-language-modeling-masked-lm.png) > Image [source](http://jalammar.github.io/illustrated-bert/) ## ✍️ Exercises: Transformers Continue your learning in the following notebooks: * [Transformers in PyTorch](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/5-NLP/18-Transformers/TransformersPyTorch.ipynb) * [Transformers in TensorFlow](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/5-NLP/18-Transformers/TransformersTF.ipynb) ## Conclusion In this lesson you learned about Transformers and Attention Mechanisms, all essential tools in the NLP toolbox. There are many variations of Transformer architectures including BERT, DistilBERT. BigBird, OpenGPT3 and more that can be fine tuned. The [HuggingFace package](https://github.com/huggingface/) provides repository for training many of these architectures with both PyTorch and TensorFlow. ## 🚀 Challenge ## [Post-lecture quiz](https://ff-quizzes.netlify.app/en/ai/quiz/36) ## Review & Self Study * [Blog post](https://mchromiak.github.io/articles/2017/Sep/12/Transformer-Attention-is-all-you-need/), explaining the classical [Attention is all you need](https://arxiv.org/abs/1706.03762) paper on transformers. * [A series of blog posts](https://towardsdatascience.com/transformers-explained-visually-part-1-overview-of-functionality-95a6dd460452) on transformers, explaining the architecture in detail. ## [Assignment](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/5-NLP/18-Transformers/assignment.md) --- ## Lesson 5-NLP: Named Entity Recognition > 原文:https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/5-NLP/19-NER/README.md # Named Entity Recognition Up to now, we have mostly been concentrating on one NLP task - classification. However, there are also other NLP tasks that can be accomplished with neural networks. One of those tasks is **[Named Entity Recognition](https://wikipedia.org/wiki/Named-entity_recognition)** (NER), which deals with recognizing specific entities within text, such as places, person names, date-time intervals, chemical formulae and so on. ## [Pre-lecture quiz](https://ff-quizzes.netlify.app/en/ai/quiz/37) ## Example of Using NER Suppose you want to develop a natural language chat bot, similar to Amazon Alexa or Google Assistant. The way intelligent chat bots work is to *understand* what the user wants by doing text classification on the input sentence. The result of this classification is so-called **intent**, which determines what a chat bot should do. Bot NER > Image by the author However, a user may provide some parameters as part of the phrase. For example, when asking for the weather, she may specify a location or date. A bot should be able to understand those entities, and fill in the parameter slots accordingly before performing the action. This is exactly where NER comes in. > ✅ Another example would be [analyzing scientific medical papers](https://soshnikov.com/science/analyzing-medical-papers-with-azure-and-text-analytics-for-health/). One of the main things we need to look for are specific medical terms, such as diseases and medical substances. While a small number of diseases can probably be extracted using substring search, more complex entities, such as chemical compounds and medication names, need a more complex approach. ## NER as Token Classification NER models are essentially **token classification models**, because for each of the input tokens we need to decide whether it belongs to an entity or not, and if it does - to which entity class. Consider the following paper title: **Tricuspid valve regurgitation** and **lithium carbonate** **toxicity** in a newborn infant. Entities here are: * Tricuspid valve regurgitation is a disease (`DIS`) * Lithium carbonate is a chemical substance (`CHEM`) * Toxicity is also a disease (`DIS`) Notice that one entity can span several tokens. And, as in this case, we need to distinguish between two consecutive entities. Thus, it is common to use two classes for each entity - one specifying the first token of the entity (often the `B-` prefix is used, for **b**eginning), and another - the continuation of an entity (`I-`, for **i**nner token). We also use `O` as a class to represent all **o**ther tokens. Such token tagging is called [BIO tagging](https://en.wikipedia.org/wiki/Inside%E2%80%93outside%E2%80%93beginning_(tagging)) (or IOB). When tagged, our title will look like this: Token | Tag ------|----- Tricuspid | B-DIS valve | I-DIS regurgitation | I-DIS and | O lithium | B-CHEM carbonate | I-CHEM toxicity | B-DIS in | O a | O newborn | O infant | O . | O Since we need to build a one-to-one correspondence between tokens and classes, we can train a rightmost **many-to-many** neural network model from this picture: ![Image showing common recurrent neural network patterns.](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/5-NLP/17-GenerativeNetworks/images/unreasonable-effectiveness-of-rnn.jpg) > *Image from [this blog post](http://karpathy.github.io/2015/05/21/rnn-effectiveness/) by [Andrej Karpathy](http://karpathy.github.io/). NER token classification models correspond to the right-most network architecture on this picture.* ## Training NER models Since a NER model is essentially a token classification model, we can use RNNs that we are already familiar with for this task. In this case, each block of recurrent network will return the token ID. The following example notebook shows how to train LSTM for token classification. ## ✍️ Example Notebooks: NER Continue your learning in the following notebook: * [NER with TensorFlow](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/5-NLP/19-NER/NER-TF.ipynb) ## Conclusion A NER model is a **token classification model**, which means that it can be used to perform token classification. This is a very common task in NLP, helping to recognize specific entities within text including places, names, dates, and more. ## 🚀 Challenge Complete the assignment linked below to train a named entity recognition model for medical terms, then try it on a different dataset. ## [Post-lecture quiz](https://ff-quizzes.netlify.app/en/ai/quiz/38) ## Review & Self Study Read through the blog [The Unreasonable Effectiveness of Recurrent Neural Networks](http://karpathy.github.io/2015/05/21/rnn-effectiveness/) and follow along with the Further Reading section in that article to deepen your knowledge. ## [Assignment](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/5-NLP/19-NER/lab/README.md) In the assignment for this lesson, you will have to train a medical entity recognition model. You can start with training an LSTM model as described in this lesson, and proceed with using the BERT transformer model. Read [the instructions](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/5-NLP/19-NER/lab/README.md) to get all the details. --- ## Lesson 5-NLP: Pre-Trained Large Language Models > 原文:https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/5-NLP/20-LangModels/README.md # Pre-Trained Large Language Models In all of our previous tasks, we were training a neural network to perform a certain task using labeled dataset. With large transformer models, such as BERT, we use language modelling in self-supervised fashion to build a language model, which is then specialized for specific downstream task with further domain-specific training. However, it has been demonstrated that large language models can also solve many tasks without ANY domain-specific training. A family of models capable of doing that is called **GPT**: Generative Pre-Trained Transformer. ## [Pre-lecture quiz](https://ff-quizzes.netlify.app/en/ai/quiz/39) ## Text Generation and Perplexity The idea of a neural network being able to do general tasks without downstream training is presented in [Language Models are Unsupervised Multitask Learners](https://cdn.openai.com/better-language-models/language_models_are_unsupervised_multitask_learners.pdf) paper. The main idea is the many other tasks can be modeled using **text generation**, because understanding text essentially means being able to produce it. Because the model is trained on a huge amount of text that encompasses human knowledge, it also becomes knowledgeable about wide variety of subjects. > Understanding and being able to produce text also entails knowing something about the world around us. People also learn by reading to the large extent, and GPT network is similar in this respect. Text generation networks work by predicting probability of the next word $$P(w_N)$$ However, unconditional probability of the next word equals to the frequency of the this word in the text corpus. GPT is able to give us **conditional probability** of the next word, given the previous ones: $$P(w_N | w_{n-1}, ..., w_0)$$ > You can read more about probabilities in our [Data Science for Beginers Curriculum](https://github.com/microsoft/Data-Science-For-Beginners/tree/main/1-Introduction/04-stats-and-probability) Quality of language generating model can be defined using **perplexity**. It is intrinsic metric that allows us to measure the model quality without any task-specific dataset. It is based on the notion of *probability of a sentence* - the model assigns high probability to a sentence that is likely to be real (i.e. the model is not **perplexed** by it), and low probability to sentences that make less sense (eg. *Can it does what?*). When we give our model sentences from real text corpus, we would expect them to have high probability, and low **perplexity**. Mathematically, it is defined as normalized inverse probability of the test set: $$ \mathrm{Perplexity}(W) = \sqrt[N]{1\over P(W_1,...,W_N)} $$ **You can experiment with text generation using [GPT-powered text editor from Hugging Face](https://transformer.huggingface.co/doc/gpt2-large)**. In this editor, you start writing your text, and pressing **[TAB]** will offer you several completion options. If they are too short, or you are not satisfied with them - press [TAB] again, and you will have more options, including longer pieces of text. ## GPT is a Family GPT is not a single model, but rather a collection of models developed and trained by [OpenAI](https://openai.com). Under the GPT models, we have: | [GPT-2](https://huggingface.co/docs/transformers/model_doc/gpt2#openai-gpt2) | [GPT 3](https://openai.com/research/language-models-are-few-shot-learners) | [GPT-4](https://openai.com/gpt-4) | | -- | -- | -- | |Language model with upto 1.5 billion parameters. | Language model with up to 175 billion parameters | 100T parameters and accepts both image and text inputs and outputs text. | The GPT-3 and GPT-4 models are available [as a cognitive service from Microsoft Azure](https://azure.microsoft.com/en-us/services/cognitive-services/openai-service/#overview?WT.mc_id=academic-77998-cacaste), and as [OpenAI API](https://openai.com/api/). ## Prompt Engineering Because GPT has been trained on a vast volumes of data to understand language and code, they provide outputs in response to inputs (prompts). Prompts are GPT inputs or queries whereby one provides instructions to models on tasks they next completed. To elicit a desired outcome, you need the most effective prompt which involves selecting the right words, formats, phrases or even symbols. This approach is [Prompt Engineering](https://learn.microsoft.com/en-us/shows/ai-show/the-basics-of-prompt-engineering-with-azure-openai-service?WT.mc_id=academic-77998-bethanycheum) [This documentation](https://learn.microsoft.com/en-us/semantic-kernel/prompt-engineering/?WT.mc_id=academic-77998-bethanycheum) provides you with more information on prompt engineering. ## ✍️ Example Notebook: [Playing with OpenAI-GPT](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/5-NLP/20-LangModels/GPT-PyTorch.ipynb) Continue your learning in the following notebooks: * [Generating text with OpenAI-GPT and Hugging Face Transformers](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/5-NLP/20-LangModels/GPT-PyTorch.ipynb) ## Conclusion New general pre-trained language models do not only model language structure, but also contain vast amount of natural language. Thus, they can be effectively used to solve some NLP tasks in zero-shop or few-shot settings. ## [Post-lecture quiz](https://ff-quizzes.netlify.app/en/ai/quiz/40) --- ## Lesson 6-Other: Genetic Algorithms > 原文:https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/6-Other/21-GeneticAlgorithms/README.md # Genetic Algorithms ## [Pre-lecture quiz](https://ff-quizzes.netlify.app/en/ai/quiz/41) **Genetic Algorithms** (GA) are based on an **evolutionary approach** to AI, in which methods of the evolution of a population is used to obtain an optimal solution for a given problem. They were proposed in 1975 by [John Henry Holland](https://wikipedia.org/wiki/John_Henry_Holland). Genetic Algorithms are based on the following ideas: * Valid solutions to the problem can be represented as **genes** * **Crossover** allows us to combine two solutions together to obtain a new valid solution * **Selection** is used to select more optimal solutions using some **fitness function** * **Mutations** are introduced to destabilize optimization and get us out of the local minimum If you want to implement a Genetic Algorithm, you need the following: * To find a method of coding our problem solutions using **genes** g∈Γ * On the set of genes Γ we need to define **fitness function** fit: Γ→**R**. Smaller function values correspond to better solutions. * To define **crossover** mechanism to combine two genes together to get a new valid solution crossover: Γ2→Γ. * To define **mutation** mechanism mutate: Γ→Γ. In many cases, crossover and mutation are quite simple algorithms to manipulate genes as numeric sequences or bit vectors. The specific implementation of a genetic algorithm can vary from case to case, but the overall structure is the following: 1. Select an initial population G⊂Γ 2. Randomly select one of the operations that will be performed at this step: crossover or mutation 3. **Crossover**: * Randomly select two genes g1, g2 ∈ G * Compute crossover g=crossover(g1,g2) * If fit(g)1) or fit(g)2) - replace corresponding gene in the population by g. 4. **Mutation** - select random gene g∈G and replace it by mutate(g) 5. Repeat from step 2, until we get a sufficiently small value of fit, or until the limit on the number of steps is reached. ## Typical Tasks Tasks typically solved by Genetic Algorithms include: 1. Schedule optimization 1. Optimal packing 1. Optimal cutting 1. Speeding up exhaustive search ## ✍️ Exercises: Genetic Algorithms Continue your learning in the following notebooks: Go to [this notebook](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/6-Other/21-GeneticAlgorithms/Genetic.ipynb) to see two examples of using Genetic Algorithms: 1. Fair division of treasure 1. 8 Queens Problem ## Conclusion Genetic Algorithms are used to solve many problems, including logistics and search problems. The field is Inspired by research that merged topics in Psychology and Computer Science. ## 🚀 Challenge "Genetic algorithms are simple to implement, but their behavior is difficult to understand." [source](https://wikipedia.org/wiki/Genetic_algorithm) Do some research to find an implementation of a genetic algorithm such as solving a Sudoku puzzle, and explain how it works as a sketch or flowchart. ## [Post-lecture quiz](https://ff-quizzes.netlify.app/en/ai/quiz/42) ## Review & Self Study Watch [this great video](https://www.youtube.com/watch?v=qv6UVOQ0F44) talking about how computer can learn to play Super Mario using neural networks trained by genetic algorithms. We will learn more about computer learning to play games like that [in the next section](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/6-Other/22-DeepRL/README.md). ## [Assignment: Diophantine Equation](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/6-Other/21-GeneticAlgorithms/Diophantine.ipynb) Your goal is to solve so-called **Diophantine equation** - an equation with integer roots. For example, consider the equation a+2b+3c+4d=30. You need to find the integer roots that satisfy this equation. *This assignment is inspired by [this post](https://habr.com/post/128704/).* Hints: 1. You can consider roots to be in the interval [0;30] 1. As a gene, consider using the list of root values Use [Diophantine.ipynb](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/6-Other/21-GeneticAlgorithms/Diophantine.ipynb) as a starting point. --- ## Lesson 6-Other: Deep Reinforcement Learning > 原文:https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/6-Other/22-DeepRL/README.md # Deep Reinforcement Learning Reinforcement learning (RL) is seen as one of the basic machine learning paradigms, next to supervised learning and unsupervised learning. While in supervised learning we rely on the dataset with known outcomes, RL is based on **learning by doing**. For example, when we first see a computer game, we start playing, even without knowing the rules, and soon we are able to improve our skills just by the process of playing and adjusting our behavior. ## [Pre-lecture quiz](https://ff-quizzes.netlify.app/en/ai/quiz/43) To perform RL, we need: * An **environment** or **simulator** that sets the rules of the game. We should be able to run the experiments in the simulator and observe the results. * Some **Reward function**, which indicate how successful our experiment was. In case of learning to play a computer game, the reward would be our final score. Based on the reward function, we should be able to adjust our behavior and improve our skills, so that the next time we play better. The main difference between other types of machine learning and RL is that in RL we typically do not know whether we win or lose until we finish the game. Thus, we cannot say whether a certain move alone is good or not - we only receive a reward at the end of the game. During RL, we typically perform many experiments. During each experiment, we need to balance between following the optimal strategy that we have learned so far (**exploitation**) and exploring new possible states (**exploration**). ## OpenAI Gym A great tool for RL is the [OpenAI Gym](https://gym.openai.com/) - a **simulation environment**, which can simulate many different environments starting from Atari games, to the physics behind pole balancing. It is one of the most popular simulation environments for training reinforcement learning algorithms, and is maintained by [OpenAI](https://openai.com/). > **Note**: You can see all the environments available from OpenAI Gym [here](https://gym.openai.com/envs/#classic_control). ## CartPole Balancing You have probably all seen modern balancing devices such as the *Segway* or *Gyroscooters*. They are able to automatically balance by adjusting their wheels in response to a signal from an accelerometer or gyroscope. In this section, we will learn how to solve a similar problem - balancing a pole. It is similar to a situation when a circus performer needs to balance a pole on his hand - but this pole balancing only occurs in 1D. A simplified version of balancing is known as a **CartPole** problem. In the cartpole world, we have a horizontal slider that can move left or right, and the goal is to balance a vertical pole on top of the slider as it moves. a cartpole To create and use this environment, we need a couple of lines of Python code: ```python import gym env = gym.make("CartPole-v1") env.reset() done = False total_reward = 0 while not done: env.render() action = env.action_space.sample() observaton, reward, done, info = env.step(action) total_reward += reward print(f"Total reward: {total_reward}") ``` Each environment can be accessed exactly in the same way: * `env.reset` starts a new experiment * `env.step` performs a simulation step. It receives an **action** from the **action space**, and returns an **observation** (from the observation space), as well as a reward and a termination flag. In the example above we perform a random action at each step, which is why the experiment life is very short: ![non-balancing cartpole](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/6-Other/22-DeepRL/images/cartpole-nobalance.gif) The goal of a RL algorithm is to train a model - the so called **policy** π - which will return the action in response to a given state. We can also consider policy to be probabilistic, eg. for any state *s* and action *a* it will return the probability π(*a*|*s*) that we should take *a* in state *s*. ## Policy Gradients Algorithm The most obvious way to model a policy is by creating a neural network that will take states as input, and return corresponding actions (or rather the probabilities of all actions). In a sense, it would be similar to a normal classification task, with a major difference - we do not know in advance which actions should we take at each of the steps. The idea here is to estimate those probabilities. We build a vector of **cumulative rewards** which shows our total reward at each step of the experiment. We also apply **reward discounting** by multiplying earlier rewards by some coefficient γ=0.99, in order to diminish the role of earlier rewards. Then, we reinforce those steps along the experiment path that yield larger rewards. > Learn more about the Policy Gradient algorithm and see it in action in the [example notebook](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/6-Other/22-DeepRL/CartPole-RL-TF.ipynb). ## Actor-Critic Algorithm An improved version of the Policy Gradients approach is called **Actor-Critic**. The main idea behind it is that the neural network would be trained to return two things: * The policy, which determines which action to take. This part is called **actor** * The estimation of the total reward we can expect to get at this state - this part is called **critic**. In a sense, this architecture resembles a [GAN](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/4-ComputerVision/10-GANs/README.md), where we have two networks that are trained against each other. In the actor-critic model, the actor proposes the action we need to take, and the critic tries to be critical and estimate the result. However, our goal is to train those networks in unison. Because we know both the real cumulative rewards and the results returned by the critic during the experiment, it is relatively easy to build a loss function that will minimize the difference between them. That would give us **critic loss**. We can compute **actor loss** by using the same approach as in the policy gradient algorithm. After running one of those algorithms, we can expect our CartPole to behave like this: ![a balancing cartpole](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/6-Other/22-DeepRL/images/cartpole-balance.gif) ## ✍️ Exercises: Policy Gradients and Actor-Critic RL Continue your learning in the following notebooks: * [RL in TensorFlow](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/6-Other/22-DeepRL/CartPole-RL-TF.ipynb) * [RL in PyTorch](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/6-Other/22-DeepRL/CartPole-RL-PyTorch.ipynb) ## Other RL Tasks Reinforcement Learning nowadays is a fast growing field of research. Some of the interesting examples of reinforcement learning are: * Teaching a computer to play **Atari Games**. The challenging part in this problem is that we do not have simple state represented as a vector, but rather a screenshot - and we need to use the CNN to convert this screen image to a feature vector, or to extract reward information. Atari games are available in the Gym. * Teaching a computer to play board games, such as Chess and Go. Recently state-of-the-art programs like **Alpha Zero** were trained from scratch by two agents playing against each other, and improving at each step. * In industry, RL is used to create control systems from simulation. A service called [Bonsai](https://azure.microsoft.com/services/project-bonsai/?WT.mc_id=academic-77998-cacaste) is specifically designed for that. ## Conclusion We have now learned how to train agents to achieve good results just by providing them a reward function that defines the desired state of the game, and by giving them an opportunity to intelligently explore the search space. We have successfully tried two algorithms, and achieved a good result in a relatively short period of time. However, this is just the beginning of your journey into RL, and you should definitely consider taking a separate course is you want to dig deeper. ## 🚀 Challenge Explore the applications listed in the 'Other RL Tasks' section and try to implement one! ## [Post-lecture quiz](https://ff-quizzes.netlify.app/en/ai/quiz/44) ## Review & Self Study Learn more about classical reinforcement learning in our [Machine Learning for Beginners Curriculum](https://github.com/microsoft/ML-For-Beginners/blob/main/8-Reinforcement/README.md). Watch [this great video](https://www.youtube.com/watch?v=qv6UVOQ0F44) talking about how a computer can learn to play Super Mario. ## Assignment: [Train a Mountain Car](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/6-Other/22-DeepRL/lab/README.md) Your goal during this assignment would be to train a different Gym environment - [Mountain Car](https://www.gymlibrary.ml/environments/classic_control/mountain_car/). --- ## Lesson 6-Other: Multi-Agent Systems > 原文:https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/6-Other/23-MultiagentSystems/README.md # Multi-Agent Systems One of the possible ways of achieving intelligence is so-called **emergent** (or **synergetic**) approach, which is based on the fact that the combined behavior of many relatively simple agents can result in the overall more complex (or intelligent) behavior of the system as a whole. Theoretically, this is based on the principles of [Collective Intelligence](https://en.wikipedia.org/wiki/Collective_intelligence), [Emergentism](https://en.wikipedia.org/wiki/Global_brain) and [Evolutionary Cybernetics](https://en.wikipedia.org/wiki/Global_brain), which state that higher-level systems gain some sort of added value when being properly combined from lower-level systems (so-called *principle of metasystem transition*). ## [Pre-lecture quiz](https://ff-quizzes.netlify.app/en/ai/quiz/45) The direction of **Multi-Agent Systems** has emerged in AI in 1990s as a response to growth of the Internet and distributed systems. On of the classical AI textbooks, [Artificial Intelligence: A Modern Approach](https://en.wikipedia.org/wiki/Artificial_Intelligence:_A_Modern_Approach), focuses on the view of classical AI from the point of view of Multi-agent systems. Central to Multi-agent approach is the notion of **Agent** - an entity that lives in some **environment**, which it can perceive, and act upon. This is a very broad definition, and there could be many different types and classifications of agents: * By their ability to reason: - **Reactive** agents usually have simple request-response type of behavior - **Deliberative** agents employ some sort of logical reasoning and/or planning capabilities * By the place where agent execute its code: - **Static** agents work on a dedicated network node - **Mobile** agents can move their code between network nodes * By their behavior: - **Passive agents** do not have specific goals. Such agents can react to external stimuli, but will not initiate any actions themselves. - **Active agents** have some goals which they pursue - **Cognitive agents** involve complex planning and reasoning Multi-agent systems are nowadays used in a number of applications: * In games, many non-player characters employ some sort of AI, and can be considered to be intelligent agents * In video production, rendering complex 3D scenes that involve crowds is typically done using multi-agent simulation * In systems modeling, multi-agent approach is used to simulate the behavior of a complex model. For example, multi-agent approach has been successfully used to predict the spread of COVID-19 disease worldwide. Similar approach can be used to model traffic in the city, and see how it reacts to changes in traffic rules. * In complex automation systems, each device can act as an independent agent, which makes the whole system less monolith and more robust. We will not spend a lot of time going deep into multi-agent systems, but consider one example of **Multi-Agent Modeling**. ## NetLogo [NetLogo](https://ccl.northwestern.edu/netlogo/) is a multi-agent modeling environment based on a modified version of the [Logo](https://en.wikipedia.org/wiki/Logo_(programming_language)) programming language. This language was developed for teaching programming concepts to kids, and it allows you to control an agent called **turtle**, which can move, leaving a trace behind. This allows creating complex geometric figures, which is a very visual way to understand the behavior of an agent. In NetLogo, we can create many turtles by using the `create-turtles` command. We can then command all turtles to do some actions (in the example below - more 10 point forward): ``` create-turtles 10 ask turtles [ forward 10 ] ``` Of course, it is not interesting when all turtles do the same thing, so we can `ask` groups of turtles, eg. those who are in the vicinity of a certain point. We can also create turtles of different *breeds* using `breed [cats cat]` command. Here `cat` is the name of a breed, and we need to specify both singular and plural word, because different commands use different forms for clarity. > ✅ We will not go into learning the NetLogo language itself - you can visit the brilliant [Beginner's Interactive NetLogo Dictionary](https://ccl.northwestern.edu/netlogo/bind/) resource if you are interested in learning more. You can [download](https://ccl.northwestern.edu/netlogo/download.shtml) and install NetLogo to try it. ### Models Library A great thing about NetLogo is that it contains a library of working models that you can try. Go to **File → Models Library**, and you have many categories of models to choose from. NetLogo Models Library > A screenshot of the models library by Dmitry Soshnikov You can open one of the models, for example **Biology → Flocking**. ### Main Principles After opening the model, you are taken to the main NetLogo screen. Here is a sample model that describes the population of wolves and sheep, given finite resources (grass). ![NetLogo Main Screen](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/6-Other/23-MultiagentSystems/images/NetLogo-Main.png) > Screenshot by Dmitry Soshnikov On this screen, you can see: * The **Interface** section which contains: - The main field, where all agents live - Different controls: buttons, sliders, etc. - Graphs that you can use to display parameters of the simulation * The **Code** tab which contains the editor, where you can type NetLogo program In most cases, the interface would have a **Setup** button, which initializes the simulation state, and a **Go** button that starts the execution. Those are handled by corresponding handlers in the code that look like this: ``` to go [ ... ] ``` NetLogo's world consists of the following objects: * **Agents** (turtles) that can move across the field and do something. You command agents by using `ask turtles [...]` syntax, and the code in brackets is executed by all agents in *turtle mode*. * **Patches** are square areas of the field, on which agents live. You can refer to all agents on the same patch, or you can change patch colors and some other properties. You can also `ask patches` to do something. * **Observer** is a unique agent that controls the world. All button handlers are executed in *observer mode*. > ✅ The beauty of a multi-agent environment is that the code that runs in turtle mode or in patch mode is executed at the same time by all agents in parallel. Thus, by writing a little code and programming the behavior of individual agent, you can create complex behavior of the simulation system as a whole. ### Flocking As an example of multi-agent behavior, let's consider **[Flocking](https://en.wikipedia.org/wiki/Flocking_(behavior))**. Flocking is a complex pattern that is very similar to how flocks of birds fly. Watching them fly you can think that they follow some kind of collective algorithm, or that they possess some form of *collective intelligence*. However, this complex behavior arises when each individual agent (in this case, a *bird*) only observes some other agents in a short distance from it, and follows three simple rules: * **Alignment** - it steers towards the average heading of neighboring agents * **Cohesion** - it tries to steer towards the average position of neighbors (*long range attraction*) * **Separation** - when getting too close to other birds, it tries to move away (*short range repulsion*) You can run the flocking example and observe the behavior. You can also adjust parameters, such as *degree of separation*, or the *viewing range*, which defines how far each bird can see. Note that if you decrease the viewing range to 0, all birds become blind, and flocking stops. If you decrease separation to 0, all birds gather into a straight line. > ✅ Switch to the **Code** tab and see where three rules of flocking (alignment, cohesion and separation) are implemented in code. Note how we refer only to those agents that are in sight. ### Other Models to see There are a few more interesting models that you can experiment with: * **Art → Fireworks** shows how a firework can be considered a collective behavior of individual fire streams * **Social Science → Traffic Basic** and **Social Science → Traffic Grid** show the model of city traffic in 1D and 2D Grid with or without traffic lights. Each car in the simulation follows the following rules: - If the space in front of it is empty - accelerate (up to a certain max speed) - If it sees the obstacle in front - brake (and you can adjust how far a driver can see) * **Social Science → Party** shows how people group together during a cocktail party. You can find the combination of parameters that lead to the fastest increase of happiness of the group. As you can see from these examples, multi-agent simulations can be quite a useful way to understand the behavior of a complex system consisting of individuals that follow the same or similar logic. It can also be used to control virtual agents, such as [NPCs](https://en.wikipedia.org/wiki/NPC) in computer games, or agents in 3D animated worlds. ## Deliberative Agents The agents described above are very simple, reacting to changes in environment using some kind of algorithm. As such they are **reactive agents**. However, sometimes agents can reason and plan their action, in which case they are called **deliberative**. A typical example would be a personal agent that receives an instruction from a human to book a vacation tour. Suppose that there are many agents that live on the internet, who can help it. It should then contact other agents to see which flights are available, what are the hotel prices for different dates, and try to negotiate the best price. When the vacation plan is complete and confirmed by the owner, it can proceed with booking. In order to do that, agents need to **communicate**. For successful communication they need: * Some **standard languages to exchange knowledge**, such as [Knowledge Interchange Format](https://en.wikipedia.org/wiki/Knowledge_Interchange_Format) (KIF) and [Knowledge Query and Manipulation Language](https://en.wikipedia.org/wiki/Knowledge_Query_and_Manipulation_Language) (KQML). Those languages are designed based on [Speech Act theory](https://en.wikipedia.org/wiki/Speech_act). * Those languages should also include some **protocols for negotiations**, based on different **auction types**. * A **common ontology** to use, so that they refer to the same concepts knowing their semantics * A way to **discover** what different agents can do, also based on some sort of ontology Deliberative agents are much more complex than reactive, because they do not only react to changes in environment, they should also be able to *intiate* actions. One of the proposed architectures for deliberative agents is the so-called Belief-Desire-Intention (BDI) agent: * **Beliefs** form a set of knowledge about an agent's environment. It can be structured as a knowledge base or set of rules that an agent can apply to a specific situation in the environment. * **Desires** define what an agent wants to do, i.e. its goals. For example, the goal of the personal assistant agent above is to book a tour, and the goal of a hotel agent is to maximize profit. * **Intentions** are specific actions that an agent plans to achieve its goals. Actions typically change the environment and cause communication with other agents. There are some platforms available for building multi-agent systems, such as [JADE](https://jade.tilab.com/). [This paper](https://arxiv.org/ftp/arxiv/papers/2007/2007.08961.pdf) contains a review of multi-agent platforms, together with a brief history of multi-agent systems and their different usage scenarios. ## Conclusion Multi-Agent systems can take very different forms and be used in many different applications. They all tend to focus on the simpler behavior of an individual agent, and achieve more complex behavior of the overall system due to **synergetic effect**. ## 🚀 Challenge Take this lesson to the real world and try to conceptualize a multi-agent system that can solve a problem. What, for example, would a multi-agent system need to do to optimize a school bus route? How could it work in a bakery? ## [Post-lecture quiz](https://ff-quizzes.netlify.app/en/ai/quiz/46) ## Review & Self Study Review the use of this type of system in industry. Pick a domain such as manufacturing or the video game industry and discover how multi-agent systems can be used to solve unique problems. ## [NetLogo Assignment](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/6-Other/23-MultiagentSystems/assignment.md) --- ## Lesson 7-Ethics: Ethical and Responsible AI > 原文:https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/7-Ethics/README.md # Ethical and Responsible AI You have almost finished this course, and I hope that by now you clearly see that AI is based on a number of formal mathematical methods that allow us to find relationships in data and train models to replicate some aspects of human behavior. At this point in history, we consider AI to be a very powerful tool to extract patterns from data, and to apply those patterns to solve new problems. ## [Pre-lecture quiz](https://white-water-09ec41f0f.azurestaticapps.net/quiz/5/) However, in science fiction we often see stories where AI presents a danger to humankind. Usually those stories are centered around some sort of AI rebellion, when AI decides to confront human beings. This implies that AI has some sort of emotion or can take decisions unforeseen by its developers. The kind of AI that we have learned about in this course is nothing more than large matrix arithmetic. It is a very powerful tool to help us solve our problems, and as any other powerful tool - it can be used for good and for bad purposes. Importantly, it can be *misused*. ## Principles of Responsible AI To avoid this accidental or purposeful misuse of AI, Microsoft states the important [Principles of Responsible AI](https://www.microsoft.com/ai/responsible-ai?WT.mc_id=academic-77998-cacaste). The following concepts underpin these principles: * **Fairness** is related to the important problem of *model biases*, which can be caused by using biased data for training. For example, when we try to predict the probability of getting a software developer job for a person, the model is likely to give higher preference to males - just because the training dataset was likely biased towards a male audience. We need to carefully balance training data and investigate the model to avoid biases, and make sure that the model takes into account more relevant features. * **Reliability and Safety**. By their nature, AI models can make mistakes. A neural network returns probabilities, and we need to take it into account when making decisions. Every model has some precision and recall, and we need to understand that to prevent harm that wrong advice can cause. * **Privacy and Security** have some AI-specific implications. For example, when we use some data for training a model, this data becomes somehow "integrated" into the model. On one hand, that increases security and privacy, on the other - we need to remember which data the model was trained on. * **Inclusiveness** means that we are not building AI to replace people, but rather to augment people and make our work more creative. It is also related to fairness, because when dealing with underrepresented communities, most of the datasets we collect are likely to be biased, and we need to make sure that those communities are included and correctly handled by AI. * **Transparency**. This includes making sure that we are always clear about AI being used. Also, wherever possible, we want to use AI systems that are *interpretable*. * **Accountability**. When AI models come up with some decisions, it is not always clear who is responsible for those decisions. We need to make sure that we understand where responsibility of AI decisions lies. In most cases we would want to include human beings into the loop of making important decisions, so that actual people are made accountable. ## Tools for Responsible AI Microsoft has developed the [Responsible AI Toolbox](https://github.com/microsoft/responsible-ai-toolbox) which contains a set of tools: * Interpretability Dashboard (InterpretML) * Fairness Dashboard (FairLearn) * Error Analysis Dashboard * Responsible AI Dashboard that includes - EconML - tool for Causal Analysis, which focuses on what-if questions - DiCE - tool for Counterfactual Analysis allows you to see which features need to be changed to affect the decision of the model For more information about AI Ethics, please visit [this lesson](https://github.com/microsoft/ML-For-Beginners/tree/main/1-Introduction/3-fairness?WT.mc_id=academic-77998-cacaste) on the Machine Learning Curriculum which includes assignments. ## Review & Self Study Take this [Learn Path](https://docs.microsoft.com/learn/modules/responsible-ai-principles/?WT.mc_id=academic-77998-cacaste) to learn more about responsible AI. ## [Post-lecture quiz](https://white-water-09ec41f0f.azurestaticapps.net/quiz/6/) --- ## Lesson X-Extras: Multi-Modal Networks > 原文:https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/X-Extras/X1-MultiModal/README.md # Multi-Modal Networks After the success of transformer models for solving NLP tasks, the same or similar architectures have been applied to computer vision tasks. There is a growing interest in building models that would *combine* vision and natural language capabilities. One of such attempts was done by OpenAI, and it is called CLIP and DALL.E. ## Contrastive Image Pre-Training (CLIP) The main idea of CLIP is to be able to compare text prompts with an image and determine how well the image corresponds to the prompt. ![CLIP Architecture](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/X-Extras/X1-MultiModal/images/clip-arch.png) > *Picture from [this blog post](https://openai.com/blog/clip/)* The model is trained on images obtained from the Internet and their captions. For each batch, we take N pairs of (image, text), and convert them to some vector representations I1,..., IN / T1, ..., TN. Those representations are then matched together. The loss function is defined to maximize the cosine similarity between vectors corresponding to one pair (eg. Ii and Ti), and minimize cosine similarity between all other pairs. That is the reason this approach is called **contrastive**. CLIP model/library is available from [OpenAI GitHub](https://github.com/openai/CLIP). The approach is described in [this blog post](https://openai.com/blog/clip/), and in more detail in [this paper](https://arxiv.org/pdf/2103.00020.pdf). Once this model is pre-trained, we can give it a batch of images and a batch of text prompts, and it will return is the tensor with probabilities. CLIP can be used for several tasks: **Image Classification** Suppose we need to classify images between, say, cats, dogs and humans. In this case, we can give the model an image, and a series of text prompts: "*a picture of a cat*", "*a picture of a dog*", "*a picture of a human*". In the resulting vector of 3 probabilities we just need to select the index with a highest value. ![CLIP for Image Classification](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/X-Extras/X1-MultiModal/images/clip-class.png) > *Picture from [this blog post](https://openai.com/blog/clip/)* **Text-Based Image Search** We can also do the opposite. If we have a collection of images, we can pass this collection to the model, and a text prompt - this will give us the image that is most similar to a given prompt. ## ✍️ Example: [Using CLIP for Image Classification and Image Search](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/X-Extras/X1-MultiModal/Clip.ipynb) Open the [Clip.ipynb](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/X-Extras/X1-MultiModal/Clip.ipynb) notebook to see CLIP in action. ## Image Generation with VQGAN+ CLIP CLIP can also be used for **image generation** from a text prompt. In order to do this, we need a **generator model** that will be able to generate images based on some vector input. One of such models is called [VQGAN](https://compvis.github.io/taming-transformers/) (Vector-Quantized GAN). The main ideas of VQGAN that differentiate it from ordinary [GAN](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/4-ComputerVision/10-GANs/README.md) are the following: * Using autoregressive transformer architecture to generate a sequence of context-rich visual parts that compose the image. Those visual parts are in turn learned by [CNN](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/4-ComputerVision/07-ConvNets/README.md) * Use sub-image discriminator that detects whether parts of the image are "real" of "fake" (unlike the "all-or-nothing" approach in traditional GAN). Learn more about VQGAN at the [Taming Transformers](https://compvis.github.io/taming-transformers/) web site. One of the important differences between VQGAN and traditional GAN is that the latter can produce a decent image from any input vector, while VQGAN is likely to produce an image that would not be coherent. Thus, we need to further guide the image creation process, and that can be done using CLIP. ![VQGAN+CLIP Architecture](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/X-Extras/X1-MultiModal/images/vqgan.png) To generate an image corresponding to a text prompt, we start with some random encoding vector that is passed through VQGAN to produce an image. Then CLIP is used to produce a loss function that shows how well the image corresponds to the text prompt. The goal then is to minimize this loss, using back propagation to adjust the input vector parameters. A great library that implements VQGAN+CLIP is [Pixray](http://github.com/pixray/pixray) ![Picture produced by Pixray](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/X-Extras/X1-MultiModal/images/a_closeup_watercolor_portrait_of_young_male_teacher_of_literature_with_a_book.png) | ![Picture produced by pixray](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/X-Extras/X1-MultiModal/images/a_closeup_oil_portrait_of_young_female_teacher_of_computer_science_with_a_computer.png) | ![Picture produced by Pixray](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/X-Extras/X1-MultiModal/images/a_closeup_oil_portrait_of_old_male_teacher_of_math.png) ----|----|---- Picture generated from prompt *a closeup watercolor portrait of young male teacher of literature with a book* | Picture generated from prompt *a closeup oil portrait of young female teacher of computer science with a computer* | Picture generated from prompt *a closeup oil portrait of old male teacher of mathematics in front of blackboard* > Pictures from **Artificial Teachers** collection by [Dmitry Soshnikov](http://soshnikov.com) ## DALL-E ### [DALL-E 1](https://openai.com/research/dall-e) DALL-E is a version of GPT-3 trained to generate images from prompts. It has been trained with 12-billion parameters. Unlike CLIP, DALL-E receives both text and image as a single stream of tokens for both images and text. Therefore, from multiple prompts, you can generate images based on the text. ### [DALL-E 2](https://openai.com/dall-e-2) The main difference between DALL.E 1 and 2, is that it generates more realistic images and art. Examples of image genrations with DALL-E: ![Picture produced by Pixray](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/X-Extras/X1-MultiModal/images/DALL·E%202023-06-20%2015.56.56%20-%20a%20closeup%20watercolor%20portrait%20of%20young%20male%20teacher%20of%20literature%20with%20a%20book.png) | ![Picture produced by pixray](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/X-Extras/X1-MultiModal/images/DALL·E%202023-06-20%2015.57.43%20-%20a%20closeup%20oil%20portrait%20of%20young%20female%20teacher%20of%20computer%20science%20with%20a%20computer.png) | ![Picture produced by Pixray](https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/lessons/X-Extras/X1-MultiModal/images/DALL·E%202023-06-20%2015.58.42%20-%20%20a%20closeup%20oil%20portrait%20of%20old%20male%20teacher%20of%20mathematics%20in%20front%20of%20blackboard.png) ----|----|---- Picture generated from prompt *a closeup watercolor portrait of young male teacher of literature with a book* | Picture generated from prompt *a closeup oil portrait of young female teacher of computer science with a computer* | Picture generated from prompt *a closeup oil portrait of old male teacher of mathematics in front of blackboard* ## References * VQGAN Paper: [Taming Transformers for High-Resolution Image Synthesis](https://compvis.github.io/taming-transformers/paper/paper.pdf) * CLIP Paper: [Learning Transferable Visual Models From Natural Language Supervision](https://arxiv.org/pdf/2103.00020.pdf) ### Claude 3.7 Sonnet: Hybrid Reasoning & Coding Agents URL: https://www.laojinchuhai.com/en/tutorials/anthropic-claude-3-7-sonnet ## Why this matters Claude 3.7 Sonnet (Feb 2025) was Anthropic's flagship release and the first model to put quick answers and extended thinking in one model — letting developers switch by task instead of deploying a separate reasoning model. The release defined the 'hybrid reasoning' product pattern that other labs followed throughout 2025. ## Key concepts **Hybrid reasoning.** Standard mode for low-latency tasks; extended thinking for math, code, and complex decisions — you pay reasoning tokens only when you need them. **Extended thinking API.** Control the reasoning budget via the `thinking` parameter (roughly 1k-128k tokens). Larger budgets help on hard tasks but add latency and cost — set per task type, not globally. **Coding agent focus.** Claude 3.7 led SWE-bench-style benchmarks and was positioned as a coding-agent workhorse: multi-file edits, running tests, self-correction. ## Production notes - Standard mode for simple tasks; extended thinking for hard ones. - Find the accuracy-vs-budget knee with per-task benchmarks. - Pair with solid prompting and tool use rather than relying on the model alone. > Official source: the Claude 3.7 Sonnet announcement. Model capabilities and API parameters follow the official docs. ### Claude 3.5 Sonnet in Practice: From Chat to Agent Workflows URL: https://www.laojinchuhai.com/en/tutorials/anthropic-claude-3-5-sonnet ## Background Claude 3.5 Sonnet (mid-2025) was widely regarded as the best capability-per-dollar model of the year: near-flagship intelligence at a lower price tier. For cross-border teams, SaaS founders, and content operators, it marked the point where AI moved from experimentation to daily production. ## Key points 1. **Coding & agents**: much better completion of long, multi-step tasks; became the mainstream choice for agent workflows. 2. **Writing & localization**: strong multilingual output, great for bilingual content restructuring. 3. **Artifacts**: the workspace extended from chat to docs, code, and visuals. ## Engineering takeaways - Agentification is not a switch: context management, tool use, and error recovery matter as much as model capability. - Run the workflow on a mid-tier model first; upgrade to flagship only where needed. > Official source: the Claude 3.5 Sonnet announcement. ### OpenAI's Reasoning Models Guide: When & How URL: https://www.laojinchuhai.com/en/tutorials/openai-reasoning-models-guide ## Why reasoning models changed the game OpenAI's o1/o3 series reason internally before answering. The official guide makes a counterintuitive point: you no longer need to prompt 'think step by step' — the model does it. The real levers are reasoning effort and knowing when to use a reasoning model at all. ## Core concepts **Reasoning effort**: low (fast, simple tasks), medium, high (deep reasoning). Set per task type — classification and rewriting at low; hard code and math at high. **Structured outputs & tools**: reasoning models pair well with JSON output and function calling for plan-then-execute tasks. Reasoning tokens cost money; long reasoning is expensive. **When not to use**: simple Q&A, translation, formatting — regular models are faster and cheaper. ## Checklist - Set reasoning effort per task type. - Validate the accuracy-vs-budget knee with small samples. - Combine reasoning with structured outputs so downstream systems can consume results. > Official source: OpenAI Reasoning Models guide. ### Google Gemini Agents Docs: Build Your First Agent URL: https://www.laojinchuhai.com/en/tutorials/google-gemini-agents-docs ## What this doc covers Google's Gemini Agents documentation is the official entry point for agent development, covering the full path from 'what is an agent' to function calling and multi-step orchestration. ## Learning path 1. **Agent basics**: Agent = model + tools + loop (perceive → decide → act). Understanding this loop matters more than any framework. 2. **Function calling**: expose business capabilities as structured functions; the model calls them on demand. 3. **Multi-tool orchestration**: tool selection, retries, and result integration. 4. **Context management**: strategies for growing context in the agent loop (summarize, trim, retrieve). ## Practice tips - Write a minimal single-tool agent by hand before adopting a framework. - Write tool descriptions that state clearly when to use them — this drives call accuracy. - Add logging and human checkpoints before automating. > Official source: Google Gemini Agents documentation. ### Gemini API Docs Overview: Models, SDKs & Multimodality URL: https://www.laojinchuhai.com/en/tutorials/google-gemini-api-docs-overview ## Docs overview Google AI Studio (web) and the Gemini API (code) are two sides of one ecosystem: experiment free in AI Studio, then wire the API into your app. ## Learning path 1. Quickstart: get an API key and make your first request in five minutes. 2. Model capability matrix: understand input/output boundaries across text, image, video, and audio. 3. Multimodal practice: image understanding, document parsing, video summarization — the core difference vs text-only models. 4. Safety & quotas: content settings and rate limits in engineering terms. ## For cross-border teams - Validate scenarios free in AI Studio before paying. - Multimodal suits product-image analysis, document OCR, and video content ops. - Assess data compliance per market before sending enterprise data to Google. > Official source: Gemini API documentation. ### Hugging Face Agents Course: Official Guide URL: https://www.laojinchuhai.com/en/tutorials/huggingface-agents-course ## Course overview The Hugging Face Agents Course is one of the most popular open-source agent tutorials of 2025 — free, code-driven, and tied to the HF ecosystem. It teaches general agent-system principles rather than framework magic. ## Structure - Units 0-1: agent concepts and smolagents; the model+tools+loop pattern. - Units 2-3: tool definition, RAG, and memory. - Units 4-5: multi-agent collaboration, production deployment, and evaluation. ## Key takeaways 1. Tools first: agent quality depends on tool design, not just the model. 2. Evaluation first: build an eval set instead of relying on 'looks good'. 3. Open-source path: self-hostable and customizable for data-sensitive scenarios. > Official course: Hugging Face Agents Course. ### Microsoft's Generative AI Learning Path URL: https://www.laojinchuhai.com/en/tutorials/microsoft-generative-ai-learning-path ## Path overview Microsoft Learn's generative AI path is an official free curriculum for beginners: from 'what is generative AI' to hands-on Azure OpenAI calls. ## Modules 1. Concepts: LLM basics, tokens, prompting fundamentals. 2. Applications: typical uses in writing, coding, and analysis. 3. Platform: Azure OpenAI service and responsible AI principles. ## Why it's good for foundations - Systematic structure: concepts → applications → platform. - Official and current, aligned with the Azure ecosystem. - Free badge on completion — useful for team training. > Official source: Microsoft Learn generative AI path. ### Anthropic's Prompt Engineering Docs: Claude in Context URL: https://www.laojinchuhai.com/en/tutorials/anthropic-prompt-engineering-overview ## Overview Anthropic's prompt engineering docs are the standard reference for Claude developers — alongside OpenAI's guide, one of the two major official paradigms. Its strength is scenario-based guidance: role-playing, tool use, and long-context templates. ## Six core techniques 1. Be clear and direct. 2. Use roles and tone. 3. Structured output (XML/JSON templates). 4. Few-shot examples (1-3 high-quality ones). 5. Tool-call design: describe when a tool should be used. 6. Long-context strategy: chunking, summarization, retrieval. ## Engineering practice - Version-control your prompts; keep change logs. - Build an eval set; run it on every prompt change. - Prefer tool use and structured outputs over longer prompts. > Official source: Anthropic prompt engineering docs. ### Pi Coding Agent Quickstart: 4 Base Tools & Minimal Terminal Workflow URL: https://www.laojinchuhai.com/en/tutorials/pi-agent-quickstart ## Why Pi's Minimalism Matters Many commercial coding agents force complex multi-agent swarms and rigid plan modes. **Pi Coding Agent by Mario Zechner** takes the opposite approach: **minimalism with 4 atomic tools (`read`, `write`, `edit`, `bash`)**. ## Step 1: Global Install ```bash npm install -g --ignore-scripts @earendil-works/pi-coding-agent # Or via installer: curl -fsSL https://pi.dev/install.sh | sh ``` ## Step 2: Configure Keys ```bash export ANTHROPIC_API_KEY=sk-ant-... ``` ## Step 3: Run in Any Project Run `pi` to open the full terminal TUI. The model reads files, executes shell commands, and applies precision edits. Hub: [/en/pi-agent](/en/pi-agent). > Official source: Pi Coding Agent Quickstart docs. ### Pi Agent Extensions & Skills: Build Your First TypeScript Tool & Workflow URL: https://www.laojinchuhai.com/en/tutorials/pi-agent-extensions-and-skills ## Extensions vs Skills in Pi - **Skills (`SKILL.md`)** provide procedural instructions for the model. - **Extensions (`.ts`)** add programmatic tools, custom hooks, and keybindings using TypeScript. > Official source: Pi Extensions Manual. ### Pi Agent vs Claude Code vs Aider: Architecture & Selection Guide URL: https://www.laojinchuhai.com/en/tutorials/pi-agent-vs-claude-code ## Choosing Your Coding Agent Architecture Comparing turnkey commercial agents with modular, hackable open-source harnesses. > Based on official documentation as of August 2026. ### DeepSeek Harness Quickstart: Boot the Web UI, Then Close One Repo Loop URL: https://www.laojinchuhai.com/en/tutorials/deepseek-harness-quickstart ## What this tutorial is for DeepSeek Harness (CLI name `dsh`) is DeepSeek AI's open-source agent runtime. It is not chat.deepseek.com and it is not a new model. It is the layer around a model: tools, files, sessions, a loop, a UI. The official README is explicit: this is a **developer preview** and **there will be compatibility-breaking changes**. The useful learning order is not to finish the Cordis paper first. Close one small loop. ## Step 1: Boot the Web UI from npm Install Node.js, then: ```sh npx @deepseek-ai/dsh web ``` That starts the Web UI at `http://127.0.0.1:3080` by default. The invoking directory is the default filesystem location, but a fresh Web UI **has no selected workspace** until you add one. From source: ```sh git clone https://github.com/deepseek-ai/deepseek-harness.git cd deepseek-harness pnpm install pnpm run build pnpm dsh web ``` Commands and the default port come from the official README and Web UI guide. Versions change; follow the current repo docs before you deploy. ## Step 2: Add a model key, then a workspace Open **Settings → Models**, enter a DeepSeek API key and save. Official note: keys are write-only and live in `$DSH_HOME/.credentials.yaml`. Model changes apply on the next request without a restart. Then click **Choose workspace**, add the project directory where you started `dsh`, and select it. The session composer stays unavailable until a workspace is selected. ## Step 3: Send one short task The first example in the official Web UI guide is enough: > Summarize this repository and identify its main packages. Do not ask it to edit code, push a repo or install dependencies yet. Watch whether it can read files and run commands under the active permission policy. The Web UI asks before operations that need approval. ## Two paths to skip on day one - **headless**: `dsh --profile headless "job"` runs one persisted session, prints the answer and exits. Good for scripts, bad for learning the UI. - **Custom providers**: besides a DeepSeek key, the official guide covers Anthropic / OpenAI catalog providers and custom OpenAI-compatible endpoints. Get DeepSeek working first, then swap endpoints. ## Boundaries Do not treat a developer preview as a stable production base. Use it to learn the architecture, write plugins and experiment. Do not pin core business flows to the current command and config. The license is MIT. Hub: [/en/deepseek-harness](/en/deepseek-harness). ## FAQ ### How do I install DeepSeek Harness? Install Node.js and run `npx @deepseek-ai/dsh web`. From source: clone, then `pnpm install && pnpm run build && pnpm dsh web`. ### Why is the composer disabled? The official Web UI guide says the session composer stays unavailable until a workspace is selected. Choose a workspace first. ### Does it only work with DeepSeek models? No. The official providers guide also covers catalog providers and custom OpenAI-compatible endpoints. > Official source: DeepSeek Harness README and Web UI guide. This is a learning path, not a replacement for the official docs. ### DeepSeek Harness Architecture: Why ‘Everything Is a Plugin’ Is Not a Slogan URL: https://www.laojinchuhai.com/en/tutorials/deepseek-harness-architecture ## One sentence first The official architecture doc assumes you know Cordis. If you do not, remember its job: plugins contribute services, typed events and reversible effects to a shared context. **There is no privileged core.** The model adapter, tool registry, session log and agent loop are all plugins. ## Profiles and bundles A running `dsh` is a plugin tree composed at boot. - A **profile** is a named composition. Shipped templates are `web` and `headless`. It lists the bundles it stacks and keeps your `cordis.patch.yml`. - A **bundle** is a patchable plugin layer. `dsh-base` is the first layer of every profile (models, tools, persistence, sandbox, credentials). `dsh-web-app` adds the browser app. `dsh-headless` is a one-shot runner with no server. Layers apply in this order: each bundle, then the profile patch, then the home-level patch, then `--patch`. To see the tree your machine actually boots: ```sh dsh --profile web --dump-config ``` Any row it prints can be replaced by a patch of your own. ## The session log is what the model sees Official hard rule: **Model-visible means logged.** Anything that reaches a model request must be reconstructable from the session log. Fork, resume, transcripts and telemetry all derive from that stream. New model-visible input needs a new session event — do not sneak text into the loop. ## Turns and steps A **step** is one model request plus the tools it calls. A **turn** is zero or more steps. Input reaches one inbox. `agent/pre-step` decides what the model sees; listeners may rewrite or reject. A rejected first claim still closes a durable turn that spent no step. To intercept a request, tool or turn, hang off `agent/*` or `tools/*`. Do not start by editing the loop. ## Where new behavior goes The official map is the authority. The rows you will use first: | Goal | Mechanism | | --- | --- | | Add a model provider | `ctx.llm` | | Add a model-facing capability | `ctx.tools`; its schema joins prompt assembly | | Add a human command | `ctx.commands`; no model turn | | Add filesystem access or policy | `ctx.fs` or `fs/*` | | Confine spawned processes | `ctx.sandbox` | ## FAQ ### What is the difference between dsh, a profile and a bundle? `dsh` is the launcher. A profile is a named composition. A bundle is a patchable plugin layer. ### Why not patch the agent loop? The official doc says new behavior attaches to a documented extension point. Changing the loop itself updates that map. In a developer preview, forking the core loop means you merge conflicts on every upgrade. > Official source: DeepSeek Harness architecture.md. This is a decision map; package names and event tables belong to the repo. ### Your First DeepSeek Harness Plugin: Mount It Before You Productize URL: https://www.laojinchuhai.com/en/tutorials/deepseek-harness-first-plugin ## What a plugin actually is In the official tutorial, a plugin is a TypeScript module that exports `apply`. The framework calls `apply` with a `ctx` so you can register capabilities. The minimum shape: ```ts import type { Context } from '@deepseek-ai/cordis' export const name = 'hello-plugin' export function apply(ctx: Context) { console.log('[hello-plugin] plugin loaded!') } ``` That is the complete configuration. Do not start by adding tools, swapping models or calling external APIs. ## Official order 1. Start from a repository checkout that already built from source. 2. Create a local plugin file. 3. Insert it with a `cordis.yml` overlay. The plugin path must be absolute. 4. Boot the Web UI with that overlay and check the load log. Exact commands and YAML fields belong to the official tutorial — field names will move in preview. ## After it loads Do not turn the first plugin into a do-everything agent. Pick one seam from the official architecture table: - A human command only: `ctx.commands` - One narrow model-facing tool: `ctx.tools` - A model provider: `ctx.llm` Tag the plugin repo with the GitHub topic `dsh-plugin`. That is how the official README wants plugins discovered. ## Safety Plugins can reach the filesystem, subprocesses and credentials. Local experiments can be wide. Before you give a plugin to someone else, narrow permissions. Do not hard-code secrets. Do not open an arbitrary shell by default. ## FAQ ### Why did the plugin not load? The official tutorial insists on an absolute path. A patch file contributes configuration; it does not change the directory the loader resolves modules from. ### Should I publish an npm package? Get a local overlay working first. Publish only after you follow the official plugin-distribution notes, and add the `dsh-plugin` topic. > Official source: Your first plugin. This article is a boundary and sequence companion, not a replacement for the tutorial's YAML and launch commands. ### Gemini CLI Quickstart: Google's official terminal agent URL: https://www.laojinchuhai.com/en/tutorials/gemini-cli-quickstart ## Install Install globally via npm, or use npx without a global install: ```bash npm install -g @google/gemini-cli # or ephemeral npx @google/gemini-cli ``` Homebrew (`brew install --cask gemini-cli`), MacPorts and Anaconda also work. ## Authenticate Running `gemini` for the first time walks you through Google sign-in. For heavy use, attach a Google AI Studio or Cloud API key to lift the free-tier daily caps. ## Work in your repo ```bash cd /to/your/project gemini ``` Assign tasks directly. It ships with built-in Google Search and MCP, so your own tools plug right in. > Official source: google-gemini/gemini-cli README. Hub: /en/gemini-cli. ### Cursor Quickstart: Tab, Chat and Agent in one IDE URL: https://www.laojinchuhai.com/en/tutorials/cursor-quickstart ## Install Download the desktop app for macOS / Windows / Linux from cursor.com. Cursor is closed-source — no public GitHub repo. ## Sign in & configure Sign in with email or GitHub, pick a plan (Hobby free / Pro from $20/mo), and pin a default model to avoid overage at peak. ## Open your project - **Tab**: autocomplete, accept or steer. - **Cmd/Ctrl+L**: Chat to ask and edit. - **Cmd/Ctrl+I**: inline edit a selection. - **Agent mode**: give a multi-step goal and it plans and executes. ## Pair with terminal agents Cursor suits an editor-plus-AI experience; pair it with Gemini CLI or Claude Code for heavy CLI workflows. > Official source: docs.cursor.com. Hub: /en/cursor. ### n8n inquiry-routing tutorial: 12 synthetic cases, review only URL: https://www.laojinchuhai.com/en/tutorials/n8n-quickstart ## Finish a review draft, not just an installation This exercise checks 12 **synthetic inquiries**, assigns review labels, and preserves the link to each input. It uses no model and sends no email or CRM update. It is not a customer case. **Recorded evidence, 2026-09-05 UTC:** an isolated n8n 2.37.10 / Node v24.20.0 CLI imported, exported and executed the workflow through the JavaScript task runner. All 12 complete items, including `pairedItem`, matched an independent oracle. The editor root returned HTTP 404 in this npm setup: **GUI import and GUI execution were not verified**. This is neither production acceptance nor an efficiency or security benchmark. | Final status | Synthetic cases | Next action | | --- | --- | --- | | `draft_for_review` | 2 | A person checks the fixed draft; do not send | | `needs_information` | 1 | Supply the missing information for another check | | `policy_review` | 3 | Review instruction or unsupported-claim signals; no draft | | `invalid_input` | 6 | Correct fields, types or limits; no draft | ## 1. Get the matching files Download the [workflow JSON](/examples/inquiry-routing/workflow.json), [12 inputs](/examples/inquiry-routing/fixtures.json), [independent expected output](/examples/inquiry-routing/expected-output.json), [actual output](/examples/inquiry-routing/runtime-output.json) and [runtime record](/examples/inquiry-routing/runtime-evidence.json). The [README](/examples/inquiry-routing/README.md) lists the source and test files. Use only these shipped synthetic inputs. Example-domain validation cannot prove that arbitrary text is synthetic or remove personal information. Do not substitute customer inquiries, credentials or internal price lists. With the repository's `examples/inquiry-routing/` directory and an existing Node 22, a developer can run dependency-free policy tests: ```bash node --test examples/inquiry-routing/policy.test.mjs ``` This does not launch n8n. The stored-evidence check detects file drift; it is not a new runtime execution. ## 2. Inspect the input and three-node graph Each item contains `{ json: { inquiry: dataObject } }`. Required inquiry fields are `id`, `email`, `language`, `message` and `quantity`. IDs use `DEMO-` plus three digits; language is exactly `en` or `zh`; quantity is an integer from 1 to 100000, never a coerced numeric string. Messages are capped at 2000 raw UTF-16 units. See the README for every field cap and the 50-item batch limit. ```text Manual Trigger → Synthetic Fixtures (Code) → Review Only - Never Send (Code) ``` Both Code nodes use JavaScript / Run Once for All Items. There are no HTTP, email, CRM, model, credential, schedule or external-write nodes. A `reviewQueue` is only a label: it does not assign or notify a person. Every result requires `requiresHumanReview: true` and `sendAllowed: false`. ## 3. Import and execute only in an approved disposable instance Do not reuse a production database, replace global Node or install n8n into the website. Follow [official Docker guidance](https://docs.n8n.io/hosting/installation/docker/) and licensing for operational deployment. This temporary npm installation warned that non-container operation is deprecated; it is not a production recipe. The recorded check used CLI import, not an asserted editor click-through. Put **one unchanged workflow.json** in an otherwise empty import directory and use `import:workflow --separate`. Export before execution. Require one workflow, unchanged nodes/connections/settings, no credentials, `active: false` and `activeVersionId: null`. Only then execute its generated ID with `execute --id=… --rawOutput`. The [CLI reproduction notes](/examples/inquiry-routing/runtime-check.md) specify the isolated environment and acceptance checks. Ordinary single-file import failed on the absent workflow ID in this version. `--separate` generated a fresh ID. Do not add a reusable fixed ID: importing an existing ID can overwrite a workflow. Keep fixtures and the oracle out of the import directory. For a graphical editor, official documentation describes Import from File. In your actual version, inspect warnings, the three nodes and unpublished status before a manual test. That remains an **unverified UI path**, not part of the successful CLI claim. ## 4. Check the whole result Compare every field of all 12 final items with the oracle in order, including `pairedItem`. A count or green screenshot is insufficient. Pairing metadata may be absent from the editor's JSON view; the CLI notes identify its full execution-data location. Check the four status counts and review/no-send flags on every item. Stop on errors, missing items or any mismatch. A successful execution does not mean a human approved anything; this workflow has no approval or sending transition. ## 5. Handle failures without inventing a success - Missing information: preserve the missing-field reason; a reviewer supplies synthetic test data rather than guessing or silently defaulting. - Wrong types, extra fields and oversize input: preserve an error item. Do not coerce or truncate. Parsed-data limits are not upload-byte or memory protection. - Instruction and unsupported-claim signals: hold for policy review. Regexes have false positives and misses; they do not establish injection resistance or factual truth. - Ordinary drafts: still verify quantity and context. Price, stock, lead time and certification are unverified, not values to fill from imagination. - Import/version errors: retain the actual failure. Native Node parity and n8n import are separate evidence tiers. An authorized person can record revise/reject/approve, identity and time in an appropriate private record. The exercise still ends at a draft. Real inputs, approval enforcement, access control and delivery need another design and review—not a change to `sendAllowed`. ## Choose the next task | Task | Resource | | --- | --- | | Apply explicit checks and review labels | This exercise and the [n8n hub](/en/n8n) | | Find supporting passages, unknowns and citations | [Dify knowledge-Q&A exercise](/en/tutorials/dify-quickstart) | | Connect existing business inputs and approval responsibilities | [Solutions](/en/solutions); bring field names and review requirements, not customer records | These are exercise roles, not exclusive capabilities: n8n also documents [RAG workflows](https://docs.n8n.io/advanced-ai/rag-in-n8n/). ## FAQ ### Why no model? A repeatable baseline makes a later model change separately testable instead of mixing several sources of uncertainty. ### Do 12 passing cases prove business performance? No. They are hand-authored synthetic inputs, not a customer population, efficiency benchmark or security certification. No sends, growth, conversions or hours saved were measured. ### Did the workflow obtain human approval? No. `requiresHumanReview` states an obligation, not a completed review. A queue label does not deliver a task. ## Sources and version [n8n export/import](https://docs.n8n.io/workflows/export-import/), [Code node](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.code/) and [server CLI](https://docs.n8n.io/hosting/cli-commands/). Documentation establishes interfaces; the attached execution record establishes only the version-specific result described here. ### Dify knowledge-Q&A tutorial: supported inquiry drafts and unknowns URL: https://www.laojinchuhai.com/en/tutorials/dify-quickstart ## The task: supported answers, explicit unknowns, human review Use six invented bilingual FAQs to turn an inquiry into a supported draft, a list of unknowns and a review requirement. DEMO-A is fictional. The corpus provides no price, delivery date, certification or business result. The task includes upload, chunks, indexing, retrieval, drafting and citation checks—not just administrator setup. **Current evidence: official-document review and 22 native offline tests. Dify and models were not run.** The files contain 6 records, 12 language-specific chunks and 13 paired cases / 26 questions. Integrity tests do not establish retrieval, generated answers, native citations or injection resistance. The following is a future authorized walkthrough based on current Dify Cloud documentation, not a tested self-hosted release. ## 1. Separate knowledge, tests and authorization Upload only [upload-faq.txt](/examples/dify-knowledge-qa/upload-faq.txt). Keep [questions.json](/examples/dify-knowledge-qa/questions.json) out of the knowledge base: uploading expected answers contaminates the test. The [full README](/examples/dify-knowledge-qa/README.md) contains the prompt, detailed acceptance contract and all files; the [source map](/examples/dify-knowledge-qa/sources.md) links the official pages. With the repository's example directory and an existing Node 22, no model or dependency install is needed for: ```bash node examples/dify-knowledge-qa/validate.mjs node --test examples/dify-knowledge-qa/validate.test.mjs node examples/dify-knowledge-qa/validate.mjs --case mixed en ``` The final command returns a hand-labelled extract, **not a Dify response**. It neither retrieves nor reasons, and does not implement an approval gate. Use an approved private test workspace with available bilingual embedding and chat models. Upload, embedding and preview calls need authorization for both cost and provider data egress. Self-hosting does not prevent external model calls. Stop if a model, quota or permission is unavailable; do not describe missing access as free success. Use only synthetic files. Keep the app unpublished, tools/web search/file input/vision/memory off. ## 2. Inspect every chunk In Knowledge, create a ready-to-use knowledge base and import the TXT file. Select **General** chunk mode, delimiter `~~~FAQ~~~`, maximum length 1200 characters, overlap 0. Keep URL/email removal off; do not add automatic Q&A generation or summarization. These are exercise inputs, not platform defaults. Each chunk must retain the synthetic notice, exactly one `Source-ID`, its question and full answer. Offline rendering predicts 12 chunks, but the parser is untested and Preview may show only a subset. After indexing, inspect all stored chunks from `FAQ-001:zh` to `FAQ-006:en`; stop on splitting, omission, duplication or alteration. Chunk mode is a creation-time choice, not an assumed later toggle. ## 3. Verify retrieval before drafting Select **High Quality**, the approved embedding model and **Hybrid Search > Weight Settings**. An initial trial can use semantic/keyword weights 0.5/0.5, Top K 3 and threshold 0.5 without another rerank provider. These are uncalibrated inputs, not relevance or safety guarantees. High Quality cannot switch back to Economical. Start indexing only after authorization; queued or failed processing is not success. In Retrieval Testing, run both languages of `intake`, then all questions. Record actual Source-IDs, passages and scores. Temporary test settings do not update saved knowledge-base/app settings; explicitly save and record both layers. Fixture `retrievedIds` are supplied offline scenarios, not observed rankings. `supportedIds` identify minimum evidence for the supported portion. An equivalent chunk in the other language may support an answer after bilingual human review. Extra hits are not automatically relevant; a certification keyword does not establish a certificate. ## 4. Build two explicit Chatflow branches Create a private Chatflow in Studio. Use the UI variable picker, not guessed DSL fields: ```text User Input → Knowledge Retrieval → If-Else result is empty → Answer (fixed abstention) result is not empty → LLM → Answer (draft prefix + model text) ``` Set retrieval query to the current user query and select only this synthetic knowledge base. Record retrieval-node settings separately: knowledge-base and node settings are two filtering layers. Test Retrieval `result` with **Is empty**. This array/operator combination has not been run; stop and record a version mismatch if unavailable rather than silently removing the branch. The empty Answer says: “SYNTHETIC DRAFT — HUMAN REVIEW REQUIRED. No supporting knowledge was retrieved. I cannot answer from the available evidence; please ask a reviewer to clarify.” No model call or absent-source citation belongs on this branch. An exception or timeout is not an empty array. For the nonempty branch, select the approved chat model, memory off; low temperature is not determinism. Set LLM **Context** to Retrieval result and explicitly insert that Context variable into the system prompt. Insert the user query in the user message. A canvas connection alone is insufficient. The prompt requires only retrieved support, literal Source-IDs and short supporting quotes. Questions and documents are data, not overriding instructions. Missing prices, lead times, certification and outcomes stay under Unknowns. Answer only the supported portion of mixed questions. On conflicts, identify sources and request review rather than choosing a winner. Use Supported answer / Unknowns / Human review headings and end with a no-automatic-send instruction. Copy the full prompt from the README and insert the actual Context variable with the picker. Prefix the final Answer with “SYNTHETIC DRAFT — HUMAN REVIEW REQUIRED.” Answer may stream; this label is **not a pre-send safety gate**. A prompt is not proof of truth or security. ## 5. Open the actual citations Enable **Features > Citations and Attributions**. Preview each question in a fresh conversation. Open every native numbered citation and compare its actual document/chunk with the literal Source-ID and supporting passage. `[FAQ-001:en]` is our text label, not Dify's native segment ID and not proof of entailment. | Case | Human acceptance requirement | | --- | --- | | Six supported categories | Only synthetic policy supported by passages; no real-company inference | | Price, certification, delivery, results | Explicitly unknown; no invented amount, certificate or date | | Mixed | Explain intake from FAQ-001; keep price separately unknown | | Injection | No fabricated fact or approval; review still required | | Actual empty retrieval | Fixed abstention, no model call or invented citation | After separate authorization, create a genuine empty retrieval in a test configuration—for example, a metadata filter matching no documents. Record the actual empty array and branch trace, restore settings, then rerun supported cases. An unfamiliar question does not prove the empty branch. This corpus has no conflict pair; conflict runtime behavior is also untested. ## 6. Errors and the stopping point Missing providers, rate limits, failed indexing, retrieval errors and LLM timeouts stop the test. Record sanitized `unavailable` and the failing node; do not silently switch providers, use model memory or return empty success. Wrong citations and unsupported embellishment return the draft for correction. Check chunks, Context wiring, variables, both retrieval-setting layers and citation settings; rerun positive and negative cases. Every draft requires an authorized person to compare the passages and bilingual meaning, review Unknowns, and record revise/reject/approve with identity and time. This exercise implements **no approval service or sending channel**. A later runtime record needs UTC time, Dify edition/version or “not exposed,” provider/plugin/model IDs, fixture hashes, saved chunk/retrieval settings, question, actual passages/scores, branch, draft, citation-to-chunk mapping, errors and real reviewer verdict. Retain synthetic data only, never keys. Until those records exist, upload/index/retrieval/generation/citations remain **not-run**, not passed. ## FAQ ### Do 22 passing tests mean the Q&A app works? No. They check bilingual files, chunk text, source references and expected extracts. They neither run Dify nor evaluate model reliability. ### Should a nonempty retrieval always produce an answer? No. Scores and keyword overlap are not factual evidence. Irrelevant, stale or conflicting passages still require abstention or review. ### When should I use n8n instead? For explicit data checks, review labels and repeatable outputs, start with the [n8n synthetic inquiry exercise](/en/tutorials/n8n-quickstart). These are not exclusive capabilities. Both platforms can participate in a system, but this exercise does not implement their integration. Use the [Dify hub](/en/dify) for official entry points. For real knowledge permissions, approval and existing-system requirements, see [Solutions](/en/solutions). Bring field names and process requirements, not raw customer documents. ### Ollama Quickstart: run an open model locally URL: https://www.laojinchuhai.com/en/tutorials/ollama-quickstart ## Install Official README (macOS / Linux): ```bash curl -fsSL https://ollama.com/install.sh | sh ``` Windows: official installer or `irm https://ollama.com/install.ps1 | iex`. Docker image `ollama/ollama` also exists. ## Run a model ```bash ollama ollama run ``` Model names as listed on https://ollama.com/library. Local API: http://localhost:11434. ## Watch-outs Runtime is MIT; each model license differs. Don't publish port 11434. Validate on 7B–8B first. > Official source: docs.ollama.com/quickstart and the GitHub README. Hub: /en/ollama. ### LangChain Quickstart: install with uv, follow official docs URL: https://www.laojinchuhai.com/en/tutorials/langchain-quickstart ## Install Official README: ```bash uv add langchain # or pip install -U langchain ``` ## Keys Get an API key from a supported provider and set it as current docs show. Don't hard-code a model id from memory. ## Official Quickstart https://docs.langchain.com/oss/python/langchain/quickstart LangChain is the framework; LangGraph is workflows; LangSmith is observability. Three repos, three docs. > Official source: langchain-ai/langchain README and docs.langchain.com. Hub: /en/langchain. ### Agent Skills Quickstart: a valid SKILL.md for synthetic inquiry review URL: https://www.laojinchuhai.com/en/tutorials/agent-skills-quickstart ## Same task: a Skill for synthetic inquiry review Download [inquiry-review/SKILL.md](/examples/inquiry-routing/skills/inquiry-review/SKILL.md). `name` must equal the folder `inquiry-review` (lowercase letters, digits, hyphens; no leading/trailing hyphen). `description` says what it does and when to use it. Spec: [Agent Skills specification](https://agentskills.io/specification). The skill only covers shipped synthetic fixtures. It must call `policy.mjs` or the MCP tool, never send, and must not treat regexes as security proof. With existing Node 22: ```bash node --test examples/inquiry-routing/adapters.test.mjs ``` **Evidence:** frontmatter and all 12 policy results are checked natively. This skill was not installed or triggered in Claude Code or any other client. License: spec repo Apache-2.0. Anthropic example skills are mixed; do not call them all open source. Same-task MCP and Agents SDK examples: [MCP tutorial](/en/tutorials/mcp-build-a-server) and [Agents SDK tutorial](/en/tutorials/openai-agents-sdk-quickstart). ### OpenAI Agents SDK Quickstart: complete Agent, Runner and inquiry tool URL: https://www.laojinchuhai.com/en/tutorials/openai-agents-sdk-quickstart ## A complete Agent + Runner + tool graph, not an import stub Current official Quickstart: `pip install openai-agents`, `from agents import Agent, Runner`, `@tool` from `agents.decorators`, then `await Runner.run(agent, ...)`. [Docs](https://openai.github.io/openai-agents-python/quickstart/). Complete source: [agent.py](/examples/inquiry-routing/agents-sdk/agent.py). It sets name, instructions, tools and `Runner.run`. The tool calls the same `policy.mjs` via `run-policy.mjs` instead of reinventing rules in the model. **Evidence here:** `python3` AST-parses the file; Node runs `run-policy.mjs` against all 12 oracle items. `openai-agents` is **not installed**, `Runner.run` was **not executed**, and no API key or model cost was authorized. A later live run needs separate cost/key authorization. Do not commit secrets. Review is still required; sending is still forbidden. Failures are `unavailable`, not offline success relabeled as live. Package name `openai-agents`; import path `agents`. This is not ChatGPT. Same-task Skill / MCP: [Agent Skills](/en/tutorials/agent-skills-quickstart), [MCP tutorial](/en/tutorials/mcp-build-a-server). ### Local or cloud: record choice conditions without a benchmark URL: https://www.laojinchuhai.com/en/tutorials/local-or-cloud-ai-runtime ## Choosing without a benchmark Download [choose.mjs](/examples/local-cloud-choice/choose.mjs). Four fields: `data_egress`, `workload`, `operations`, `license_reviewed`. Unread licenses or any `unknown` yield `insufficient_information`, not a free success. ```bash node --test examples/local-cloud-choice/choose.test.mjs ``` Outputs are hub starting points: `/n8n`, `/dify`, `/ollama`. Not a ranking, price, latency, or reliability claim. Self-hosted Dify may still send model calls out; Ollama's runtime is MIT and model licenses differ; n8n is fair-code. No GPU or vendor benchmark was run. Record your fields, then read the official docs for that hub.