1 of 21

Autonomous Agents

In the context of LLM

Vinod

2 of 21

Introduction

Large Language Models (LLMs) are a subset of Deep Learning

Deep Learning

Large Language Models

3 of 21

In News!

Prompt is all you need

1 Million users in 5 days

OpenAI’s report on labor market impact of large language models

4 of 21

What is a large language model (LLM)?

(+fine-tuning)

Natural language sequence �(+prompt engineering)

Natural language sequence �(→ images, music, code, actions)

Training data (lots of text from the web)

Magic prediction black box

common crawl

wikipedia

webtext2

books

Model: input-output algorithm that learns (adjusts its internal variables) by “trial and error” from data

Language: takes as input a window of test, generates new text by predicting the next word, repeatedly

Large: many variables, trained on a huge dataset of examples

5 of 21

LLM Evolution

Source: [1]

6 of 21

What are Prompts and Prompt Engineering

Prompt Design

��

Prompt involve instructions and context passed to a language model to achieve a desired task

Prompt Engineering

��

Prompt engineering is the practice of developing and optimizing prompts to efficiently use language models for a variety of applications.

Completion

Task description

Input text

LLM

prompt

Completion

Task description

Input text

LLM

prompt

Output indicator

Source: [2]

7 of 21

ChatGPT: Behind the scenes

Who is the prime minister of Singapore?

The prime minister of Singapore was Lee Hsien Loong

What is his age?

The age of prime minister Singapore, Lee Hsien Loong, was 71 years old�…

Ask me anything…

Context�- Singapore

- Prime Minister

Build Context

Context�- Singapore

- Prime Minister�- Lee Hsien Long

Build Context

Feed

Context�- Singapore

- Prime Minister�- Lee Hsien Long�- 71 years old

Build Context

Context aware

Complete the rhyme:�Roses are red, oceans is blue

Sugar is sweet, and so are you.

The sky is blue and

The clouds are white,�It’s beautiful day, what a sight!

Ask me anything…

Prompts�- Tone: Soft

- Rhyme�- Lang: English

Build Prompts

Prompts�- Tone: Soft

- Rhyme�- Lang: English�- Mode: Happy

Build Context

Feed

Prompts�- Tone: Soft

- Rhyme�- Lang: English�- Mode: Happy

Build Prompts

Prompt Engineering

Can you give me the winning number for next ToTo game?

I'm sorry, but as an AI language model, I don't have the ability to predict or provide winning numbers for any lottery or gambling game. It's important to remember that lottery games are purely based on chance, and any number or combination of numbers has an equal chance of being drawn as a winning number.

Ask me anything…

Constraints�- Lottery�- Gambling

Build Constraints

Moderation

Feed

Source: [3]

8 of 21

LLM Development vs. Traditional Development

YES ML expertise needed

YES training examples

YES need to train a model

YES compute time + hardware

Thinks about minimizing a loss function

Traditional ML Development

NO ML expertise needed

NO training examples

NO need to train a model

Thinks about prompt design

LLM Development�(using pre-trained APIs)

Source: [1]

9 of 21

  • Setting objective
    • “Build a mental health journaling app”

  • Breaking down the tasks
    • “Search google for mental health journaling app competitors”
    • Write JavaScript code for a web app page to record user’s mood”

  • Prioritization
    • Decide which task it should do next

  • Execution
    • Execute the task – either by itself or by external tools

  • Evaluation & Creating New Tasks
    • Evaluate and come up with new tasks that need to be done to achieve final objective

  • Repeat
    • Repeat above steps until the objective is achieved

How do autonomous agents work?

Source: [4]

10 of 21

Generative Agents�Westworld simulation

Source: [5]

*Click on the image for the demonstration of an actual simulation of the generative agent society

11 of 21

Generative Agents�Agent Architecture

Source: [5]

12 of 21

Applications

    • Virtual reality metaverses and social robots
    • Human-centered design process

Limitations

    • Output behavior or stereotypes that reflect bias
    • Fail to generate believable behavior for some subpopulations
    • Vulnerable to prompt hacking, memory hacking, and hallucination

Applications and Limitations

Source: [5]

13 of 21

  • Role-playing agent framework to facilitate autonomous cooperation among communicative agents

  • Inception prompting to guide chat agents toward task completion

  • Role-playing can be used to generate conversational data for studying the behaviors and capabilities of chat agents

CAMEL (Communicative Agents for “Mind” Exploration of Large-Scale Language Model Society)

Source: [6]

14 of 21

  • Only one agent

  • High-level idea
    • User provides an objective and an initial task
    • The system starts a loop where it continuously checks for tasks in the task list to execute, create and prioritize
    • The loop continues until all tasks are completed

  • Core components
    • Task Creation Agent
    • Task Prioritization Agent
    • Task Execution Agent

BabyAGI�Task-driven Autonomous Agent

Source: [8]

15 of 21

Demo

16 of 21

  • Automate a wide range of tasks, from writing articles to generating code

  • Three key inputs
    • AI Name
    • AI Role
    • Up to five goals

  • Four main components
    • Architecture
    • Autonomous iterations
    • Memory Management
    • Multi-functionality

AutoGPT�

Source: [7]

Make it versatile

17 of 21

Demo

Source: [7]

18 of 21

  • LangChain is a framework that can orchestrate a series of prompts to achieve a desired outcome.

LangChain

Answer

Action

Your data

General knowledge

Components

Chains

Agents

-LLM Wrappers

-Prompt Templates

-Indexes for relevant information retrieval

Assemble components to solve a specific task, such as finding info in a book

Agents allow LLMs to interact with it’s environment. For instance, make API request with a specific action.

Source: [9]

19 of 21

Vinod © Continental AG

19

7/22/2023

Demo�Question + Relevant Info

Question

Similarity Search

Answer

Relevant Info

20 of 21

  • Intelligent systems powered by LLMs helps to achieve a long-term goal

  • Abilities include – Basic language, Reasoning, Using external tools, and Access to long term memory

  • Can potentially change the business landscape – reducing cost and improving productivity

  • Limitations: Looping quagmire, problem decomposition, base cases, understanding context, overlapping subproblems

Summary

Generative agent systems: A promising direction for the future of AI

21 of 21

References