1 of 46

CSCI-SHU 376: Natural Language Processing

Hua Shen

2026-04-21

Spring 2026

Lecture 16: LLM Agents

Contents adapted from EMNLP 2024 Tutorial on Language Agents

2 of 46

Today’s Plan

  • Language Agents Overview
  • Foundations: Reasoning, Memory, Planning
  • Data, Application, Evaluation

3 of 46

What is Agent?

3

4 of 46

Recap: Reinforcement Learning

 

5 of 46

Modern Agent

  • LLM + external environment?

6 of 46

Two Competing Views

  • LLM first view: make LLM as an agent
    • I.e. LLM perceives from environment and acts accordingly
    • Just prompt engineering?

  • Agent first view: Integrate LLM into AI agents so they can use language for reasoning and communication
    • We re-examine the challenges (e.g., perceptron, reasoning, communication) in the new lens of LLMs

7 of 46

What’s different now?

  • LLM agent can use language for reasoning and communication

8 of 46

Revisit Classic view of agents

9 of 46

Language Agents Definition

  • AI agents capable of using language for reasoning and communication are called “language agents”.

10 of 46

Today’s Plan

  • Language Agents Overview
  • Foundations: Reasoning, Memory, Planning
  • Data, Application, Evaluation

11 of 46

Key Concepts for Language Agents

  • Action Space
    • Reasoning: Update short-term memory
    • Retrieval: Update long-term memory

  • Planning:
    • Choose action(s) from the action space

12 of 46

Recap: Reasoning

13 of 46

Why Reasoning is helpful for Agents?

14 of 46

ReAct

  • Combine reasoning and acting with LMs

15 of 46

The flexibility of “Act”

16 of 46

The flexibility of “Act”

17 of 46

Why reasoning is special for agents?

  • Action space is infinite
  • LLMs learn reasoning priors by imitating human reasoning tracks

18 of 46

Reasoning: Take-aways

  • Reasoning as internal actions for agents
    • No external feedback, just change internal context
  • Reasoning guides acting, acting updates reasoning

19 of 46

Recap: Retrieval-based Language Models (RALM)

Inference

  • Retrieval-based LM = Retrieval + LMs (or commonly referred as RAG)
  • It retrieves from an external datastore

19

20 of 46

Agent Memory

Inference

  • Not only others’ knowledge, could be own experience as well
  • Also be able to write to it!

20

21 of 46

Generative Agents

Inference

21

22 of 46

Generative Agents

Inference

  • The need for memory
    • Context window cannot possibly hold all event streams
    • Even if possible, long-context modeling might be challenging

22

23 of 46

Generative Agents

Inference

23

24 of 46

Implementing memory

Inference

  • Naïve Implementation
    • Read: off-the-shelf retriever
    • Write: Append to text corpus

  • Some interesting new implementations
    • Read: online retrieval
    • Write: index augmentation with referrel

24

25 of 46

Memory: Take-aways

  • Language agents interact with external environments and internal memories
    • Short-term memory: reasoning
    • Long-term memory: (event logs, codebase etc), retrieval

26 of 46

Planning: definition

  • General trends in planning:
    • Increasing expressiveness in goal specification: in natural language instead of formal language
    • Open-ended action space
    • Increasing difficulty in automated goal test

27 of 46

Language agent planning: web agents

28 of 46

Language agent planning: travel planning

29 of 46

Planning: take-aways

  • Language agents are expanding into new planning scenarios
    • Expressive but fuzzy goal specifications, open-ended action spaces, etc

  • Language for reasoning also enables new planning abilities
    • The best planning strategy is dependent on the LLM

  • Still a pretty open-ended question

30 of 46

Today’s Plan

  • Language Agents Overview
  • Foundations: Reasoning, Memory, Planning
  • Data, Application, Evaluation

31 of 46

Agent Applications

32 of 46

Coding Agents

  • API calling for tool use
    • Environment: software system such as database, app services
    • Observation space: API docs, system info
    • Action space: function calls, etc

33 of 46

Coding Agents

  • Project-level coding tasks
    • Environment: project code repos, filesystems
    • Observation space: code files, exe outputs, docs etc
    • Action space: code updates, files search etc

34 of 46

Gaming Agents

  • Digital Games
    • Environment: game world
    • Observation space: screenshot of game states, inventory etc
    • Action space: game controls

35 of 46

Web agents

  • Web / app use
    • Environment: web browsers / apps
    • Observation space: screenshots, DOM trees, HTML, historical actions
    • Action space: browser / app controls

36 of 46

Computer use agents

  • Computer use for universal digital tasks: OSWorld
    • Environment: desktop operating systems
    • Observation space: desktop screenshots, historical actions
    • Action space: keyboard / mouse controls

37 of 46

Computer use agents

38 of 46

Robotic agents

  • Robotics for physical interaction
    • Environment: physical world spaces
    • Observation space: visual inputs, sensor, physical states
    • Action space: motor controls

39 of 46

Agent Data

40 of 46

Agent Data Example

  • Task goal aligned trajectories

41 of 46

Unifying digital agent data

  • Digital agent data unification
    • Observation: screenshots
    • Actions: universal computer mouse and keyboard controls

42 of 46

Agent Evaluation

43 of 46

Recap: What is a good benchmark?

  • Difficulty
  • Diversity
  • Usefulness
  • Reproducibility
  • Data Contamination

44 of 46

Good Agent benchmark?

  • Natural and challenging tasks
  • Good agent evaluation framework
    • Realistic agent environment
    • Automatic task setup
    • Automatic task evaluation

45 of 46

Recap: Chatbot Arena

  • https://lmarena.ai
  • Ask human to vote which response is better!

46 of 46

Computer Agent Arena

  • An open evaluation platform where users can compare AI-agents performing real-world computer use tasks