The Hidden Life of Embeddings: Linus Lee

AI Engineer
7 Nov 202318:14

Summary

TLDRIn this inaugural AI engineer conference talk, L from Notion shares their journey with AI, focusing on the power of embeddings and latent spaces in language models. With a background in experimenting with traditional NLP and language models, L delves into how embeddings offer a more direct control over steering language models, akin to navigating with precision rather than guesswork. Through practical examples, including manipulating text and image embeddings, L demonstrates the potential for creating expressive interfaces and the ability to interpret and control models more intuitively. The talk highlights recent advancements, introduces open-source models for experimentation, and envisions a future where interfaces allow deeper interaction and understanding of AI's underlying mechanisms.

Takeaways

  • πŸ˜ƒ L from Notion discussed the power and potential of embeddings in AI at the inaugural AI engineer conference.
  • πŸ‘¨β€πŸ’» Before joining Notion, L worked independently on language models and traditional NLP techniques like TF-IDF and BM25 to create innovative reading and writing interfaces.
  • πŸš€ Notion AI was launched around November 2022, introducing features like AI autofill and translation, with more innovations on the way.
  • πŸ‘₯ Notion is actively seeking AI engineers, product engineers, and machine learning engineers to expand their team.
  • 🚨 L highlighted the challenge of steering language models effectively, likening it to controlling a car with a pool noodle from the back seat.
  • πŸ” Latent spaces within embedding models offer a more direct layer of control by allowing inspection and manipulation of model internals, beyond just using prompts.
  • πŸ’¬ By exploring embeddings and latent spaces, L demonstrates how to build more expressive interfaces and achieve a deeper understanding of what models 'see' in their inputs.
  • πŸ“ˆ L showcased practical examples of manipulating embeddings for text and images to alter content length, sentiment, and even blend concepts in creative ways.
  • πŸ”§ The talk introduced custom models based on T5 architecture, fine-tuned and adapted for unique tasks like embedding recovery and model interoperability.
  • πŸ“¦ L announced the availability of their models on Hugging Face, encouraging others to experiment with them and share findings.

Q & A

  • What is the main focus of the talk given by the speaker at the inaugural AI engineer conference?

    -The main focus of the talk is on embeddings and latent spaces of models, particularly how they can be used to control and interpret AI models more directly.

  • What is the speaker's background and their work prior to the conference?

    -The speaker, L, has worked on AI at Notion for the last year or so, and before that, did a lot of independent work experimenting with language models, traditional NLP techniques like TF-IDF and BM25, and embedding models to build interfaces for reading and writing.

  • What are some of the new features launched in Notion AI since its public beta in November 2022?

    -Since the public beta in November 2022, Notion AI has steadily launched new features including AI autofill inside databases and translation.

  • Why does the speaker compare prompting language models to steering a car with a pool noodle?

    -The speaker uses this analogy to illustrate the indirect and somewhat imprecise control one has over language models when using just prompts, highlighting the challenges in steering the model's output directly.

  • What are latent spaces, and why are they important according to the speaker?

    -Latent spaces are high-dimensional vector spaces inside models, including embedding models and activation spaces. They are important because they potentially encode salient features of the input data, offering a more direct layer of control and understanding of the model's operations.

  • How does the speaker propose to manipulate embeddings to achieve more direct control over model outputs?

    -The speaker suggests that by understanding and intervening in the latent spaces of models, specifically by manipulating embeddings, one can achieve a more direct control over the model's outputs and build more expressive interfaces.

  • Can you describe an example given by the speaker of how embeddings can be manipulated?

    -The speaker describes manipulating embeddings to vary text length while maintaining the topic, by identifying a direction in the embedding space that represents shorter text and then moving the embedding in that direction before decoding it back to text.

  • What innovative visual representation did the speaker showcase?

    -The speaker showcased a visual representation of their transformation from beginning to end, showcasing the transition from a photographic to a cartoon version of themselves.

  • What is the significance of the research work mentioned by the speaker, such as the AO World model paper?

    -The research work, including the AO World model paper, is significant because it represents groundbreaking efforts in understanding and manipulating latent spaces within models, offering new ways to interpret and control AI models' behaviors.

  • How does the speaker view the future of human interfaces to knowledge in the context of AI?

    -The speaker is optimistic about the future, believing that by digging deeper into what models are actually looking at and building interfaces around them, more human-centric interfaces to knowledge are possible, enhancing our understanding and interaction with AI.

Outlines

00:00

πŸ—£ Introduction to Embeddings at the AI Conference

The speaker, identified as L, introduces themselves at the inaugural AI engineer conference, discussing their background in AI at Notion and independent work on language models and embeddings. They highlight Notion AI's development over the past year, including new features and the ongoing search for AI engineers. L emphasizes the importance of direct control over language models, comparing the usual indirect control to steering a car with a pool noodle. They propose that a closer examination of latent spaces within models could offer a more direct layer of control, making the interaction with models more effective.

05:01

πŸ” Exploring Latent Spaces and Embeddings

L delves into the concept of latent spaces and embeddings, explaining how these can represent the most salient features of text or images. They demonstrate using an encoder-decoder model to manipulate embeddings, showing how slight alterations can produce variations in text outputs that maintain the general idea but vary in specifics. L introduces an interactive tool for exploring latent spaces, allowing for manipulation of text characteristics such as length and sentiment. They also highlight the potential of embedding models to understand and modify text in meaningful ways, suggesting a more nuanced control over model outputs.

10:03

πŸ”¬ Advanced Techniques with Embeddings

L showcases advanced techniques for working with embeddings, including adapting models to understand embeddings from different sources, such as OpenAI's models. They present experiments with image embeddings, demonstrating interpolation between images and manipulation based on textual descriptions to alter image characteristics. L emphasizes the surprising effectiveness of these methods in blending and modifying content meaningfully, suggesting that even complex features like proper nouns and themes can be manipulated through embedding space arithmetic. This section underscores the potential for creative and precise model control through embeddings.

15:05

πŸ›  Tools, Models, and Future Directions

In the concluding section, L discusses the technical details of the models used in their demonstrations, including a custom text model based on T5 and an image model capable of converting clip embeddings back to text or images. They announce the availability of these models on Hugging Face, encouraging others to experiment and share results. L reflects on the broader implications of their work, suggesting that understanding and manipulating model representations can lead to more intuitive and human-friendly interfaces for interacting with AI. The talk ends with an invitation to explore these tools further, emphasizing the ongoing exploration of AI's capabilities.

Mindmap

Keywords

πŸ’‘Embeddings

Embeddings are a key concept in natural language processing and machine learning, representing words, sentences, or documents as vectors in a high-dimensional space. These vectors capture semantic information, meaning similar words or texts are closer in this space. In the video, embeddings are discussed as a crucial tool for understanding and manipulating latent spaces in AI models, particularly for tasks like steering language models, and building interfaces for reading and writing. The speaker illustrates how embeddings can encapsulate the most salient features of text or images and can be manipulated to alter the output of generative models, showing examples of changing text length or sentiment by adjusting embeddings.

πŸ’‘Latent Spaces

Latent spaces refer to the abstract, high-dimensional spaces where embeddings reside. They encapsulate the underlying patterns and features learned by a model from the data. In the context of the video, latent spaces are explored as areas within AI models that, when understood and manipulated, can provide more direct control over the model's output. The speaker uses the metaphor of steering a car with a pool noodle to describe the challenge of controlling models through prompts alone and suggests that intervening in latent spaces might offer a more precise mechanism for directing model behavior.

πŸ’‘Notion AI

Notion AI is mentioned as a product developed by the speaker's company, which integrates artificial intelligence into the Notion workspace. The video marks almost a year since its launch, highlighting its role in introducing new features like AI autofill and translation within databases. This context situates the speaker's work and interests in practical applications of AI to enhance productivity tools, underlining the ongoing efforts to refine AI capabilities and user interfaces in software products.

πŸ’‘Steering Language Models

Steering language models refers to the process of guiding the generation of text by a language model towards desired outcomes. The speaker likens it to steering a car with a pool noodle from the back seat, illustrating the indirect and somewhat imprecise control users have when using prompts. This concept is central to the discussion on finding more effective ways to influence model behavior, particularly through the manipulation of latent spaces and embeddings, aiming for a closer layer of control over the generative processes.

πŸ’‘Vector Spaces

Vector spaces are mathematical constructs where vectors reside, and in the context of AI, they represent the domain of embeddings. These spaces allow for operations like addition, subtraction, and scaling, facilitating the manipulation of embeddings. The video discusses how embeddings in vector spaces can encode information about text or images and how moving or adjusting these vectors can change the information represented, such as altering text length or sentiment, showcasing the potential for direct interaction with model outputs through vector space manipulation.

πŸ’‘Encoder-Decoder Models

Encoder-decoder models are a type of neural network architecture used for a variety of tasks like machine translation, text summarization, and more. They work by encoding input data into an abstract representation (embedding) and then decoding it to produce output in the desired form. The speaker describes using an encoder to transform text into embeddings and a decoder to revert embeddings back into text, demonstrating this architecture's utility in exploring and manipulating latent spaces for creative and controlled generation of content.

πŸ’‘Semantic Blur

Semantic blur refers to the loss of specificity or detail in generated text when embeddings are manipulated, such as by adding noise or blurring the vector representation. The speaker uses this concept to show how varying the precision of embeddings affects the clarity of the generated text, illustrating the relationship between the manipulation of embeddings in latent spaces and the resulting output quality. This highlights the challenges and possibilities of tuning AI models for desired outcomes through direct manipulation of embeddings.

πŸ’‘Fine-tuning

Fine-tuning is a machine learning technique where a pre-trained model is further trained or adjusted on a new, often smaller, dataset to adapt to specific tasks or improve performance on particular metrics. In the video, fine-tuning is mentioned in the context of adapting an un-embedding model to interpret embeddings from different models, demonstrating how models can be refined to enhance compatibility and functionality across different embedding spaces, thereby extending their applicability and effectiveness.

πŸ’‘Generative Models

Generative models are AI models capable of generating new data samples that resemble the training data. These include language models for text generation and diffusion models for image generation. The speaker discusses using generative models to explore latent spaces and manipulate embeddings to control generation processes, such as changing the style or sentiment of text and creating transitions between images. This showcases the creative potential of generative models when combined with an understanding of latent spaces.

πŸ’‘Interpretable Representations

Interpretable representations refer to model outputs or internal representations that can be easily understood and manipulated by humans. The speaker emphasizes the importance of creating models whose latent spaces encode information in ways that are controllable and understandable, allowing for direct manipulation to achieve desired outcomes. This is linked to the broader goal of making AI models more transparent and user-friendly, enabling more intuitive interaction and customization by end-users.

Highlights

Introduction of the speaker, L, discussing their work on AI at Notion and experience with language models and embedding models.

Mention of Notion AI's progress since its public beta launch in November 2022, highlighting new features like AI autofill and translation.

Discussion on the challenge of steering language models effectively, comparing it to steering a car with a pool noodle.

Introduction to latent spaces and their significance in understanding and manipulating AI model behaviors.

Explanation of embedding models, illustrating how they encapsulate salient features of texts or images in high-dimensional vector spaces.

Demonstration of how modifying embeddings can alter generated content, showcasing the control over text length and sentiment.

Introduction to a custom AI tool that allows interactive manipulation of embeddings to explore latent space.

Showcasing the potential of embeddings to interpret and control AI output by varying and mixing embeddings.

Discussion on the ability to project text attributes in embedding space, revealing how models perceive different texts.

Demonstration of embedding space manipulation to blend different textual or visual inputs seamlessly.

Explanation of using linear adapters to adapt models for reading out text from different embedding spaces.

Availability of the speaker's custom models and tools for public use on Hugging Face, encouraging community experimentation.

Introduction to an image model based on CLIP embeddings, facilitating manipulations and interpolations in image space.

Highlighting the interdisciplinary research and recent developments in understanding and leveraging latent spaces.

Emphasis on the practicality of making AI models' internal processes more observable and interactive for deeper insights.

Concluding thoughts on the future of human interfaces to knowledge, inspired by interactive and manipulable AI models.

Transcripts

play00:01

[Music]

play00:14

everyone I'm L I'm here to talk about

play00:16

embeddings um grateful to be here at the

play00:18

inaugural a engineer conference who

play00:19

learned something new

play00:21

today yeah um before I talk about that a

play00:25

little about myself if you don't know me

play00:26

already I am lus I work on AI at notion

play00:30

uh for the last year or so before that I

play00:32

did a lot of independent work

play00:33

prototyping experimenting with trying

play00:35

out different things with language

play00:36

models with traditional LP things like

play00:38

tfidf bm25 to build interesting

play00:40

interfaces for reading and writing in

play00:42

particular I worked a lot with embedding

play00:43

models and Laten spaces of models which

play00:45

is what I'll be I'll be talking about

play00:47

today but before I do that I want to

play00:50

take a moment to say it's been almost

play00:52

year since notion launched notion AI our

play00:54

public beta was first announced in

play00:56

around November 2022 so as we get close

play00:59

to a year we we've uh been steadily

play01:00

launching new and interesting features

play01:02

inside notion AI from November we have

play01:05

ai autofill inside databases translation

play01:07

and things coming soon though not today

play01:10

so keep an eye on the space and

play01:12

obviously we're hiring just like

play01:14

everybody else here we're looking for AI

play01:15

Engineers product Engineers machine

play01:17

learning Engineers to tackle the full

play01:19

gamut of problems that people have been

play01:20

talking about today agents tool use

play01:22

evaluations data uh training and all the

play01:26

interface stuff that that we'll see

play01:27

today and tomorrow so if you're

play01:28

interested please grab me and uh and

play01:30

we'll have a little

play01:32

chat now it wouldn't be Al us talk

play01:34

without talking about lat in spaces so

play01:35

let's talk about it um the the one of

play01:38

the problems that I find always

play01:39

motivated by is the problem of steering

play01:41

language models and I always say that

play01:42

prompting language models feels a lot

play01:44

like you're steering a car from the back

play01:45

seat with a pool noodle like yes

play01:47

technically you have some control over

play01:49

the motion of the vehicle so like

play01:50

there's some connection but like you're

play01:52

not really in the driver's seat the

play01:53

control isn't really there it's not

play01:54

really direct there's like three layers

play01:56

of indirection between you and what the

play01:57

vehicle is doing and that to me

play02:00

trying to prompt a model especially

play02:02

smaller more efficient models that we

play02:03

can use for production with just tokens

play02:06

just prompts feels a lot like uh there's

play02:08

too many lers of indirection and as even

play02:10

though models are getting better at

play02:12

understanding prompts I think there's

play02:13

always going to be this fundamental

play02:14

barrier between indirect kind of control

play02:16

of models with just prompts and and

play02:18

getting with the model getting the model

play02:19

to do what what we want them to do and

play02:21

so perhaps we can get a closer layer of

play02:23

control a more direct layer of control

play02:25

by looking inside the model which is

play02:26

where we look at latent spaces latent

play02:29

spaces arise I think uh most famously

play02:33

inside embedding models if you embed

play02:35

some pieces of text that Vector of 1536

play02:37

numbers or 1024 numbers is inside a high

play02:40

dimensional Vector space that's a latent

play02:42

space but also you can look at Vector at

play02:44

the latent spaces inside activation

play02:46

spaces of models inside token embeddings

play02:47

inside image models and then obviously

play02:49

other model architectures like Auto

play02:50

encoders today we're going to be looking

play02:52

at embeding embedding models but I think

play02:54

a lot of the general takeaways apply to

play02:56

other models and I think there's a lot

play02:57

of fascinating research work happening

play02:58

inside other models as well well when

play03:01

you look at an embedding you kind of see

play03:03

this right you see like rows and rows of

play03:05

numbers if you ever debugged some kind

play03:07

of an embedding Pipeline and you print

play03:08

out the embedding you can kind of tell

play03:09

it that's like a thousand numbers but

play03:10

it's just looking at like a matrix uh

play03:13

screen of numbers ring down but in

play03:15

theory there's a lot of information

play03:17

actually packed inside those embeddings

play03:18

if you get an embedding of a piece of

play03:19

text or image these latent spaces these

play03:21

embeddings represent in theory the most

play03:24

Salient features of the text or the

play03:26

image that the model is using to lower

play03:27

its loss or do its task and so maybe can

play03:30

disentangle some meaningful attributes

play03:32

or features out of these embeddings if

play03:34

we can look at them a little more

play03:35

closely and and and interpret them a

play03:36

little better maybe we can build more

play03:38

expressive interfaces that let them

play03:39

control the model by interfering or

play03:41

intervening inside the

play03:43

model another way to say that is that

play03:45

emedic show embeddings show us what the

play03:47

model sees in a sample of input so maybe

play03:50

we can read out what it sees and try to

play03:51

understand better what what the model's

play03:53

doing and maybe we can even control the

play03:55

embedding intermediate activations to

play03:58

see uh what the model can generate

play04:00

so let's uh let's see some of

play04:11

that so some of this some of you might

play04:13

have seen before but I promise there's

play04:14

some new stuff at the end so hang tight

play04:16

so here are some sentence that I have

play04:18

it's a sentence about this novel one of

play04:19

my favorite novels named diaspora it's a

play04:22

science fiction novel by Greg Egan that

play04:24

explores the evolution and existence of

play04:25

postum artificial intelligences uh

play04:27

something to do with alien civilizations

play04:29

and the questioning the nature of

play04:30

reality and Consciousness which you

play04:32

might be doing a lot given all the

play04:33

things that are happening and so I have

play04:36

I have I've trained this model that can

play04:39

uh generate some embeddings out of this

play04:41

text so if I hit this enter it's going

play04:42

to give us an embedding but it's a it's

play04:44

an embedding of length 248 and so it's

play04:46

it's quite large but it's just a row of

play04:48

numbers right but then I have a A decod

play04:50

or half of this model they can take this

play04:52

embedding and try to reconstruct the

play04:54

original input that may have produced

play04:56

this embedding so in this case it took

play04:58

the original sentence there's some Vari

play04:59

you can tell it's not exactly the same L

play05:01

maybe but it's mostly reconstructed the

play05:03

original sentence including specific

play05:05

details like the title of the book and

play05:07

so so we have an encoder that's going

play05:09

from text to embedding and a decoder

play05:11

that's going from embedding back to text

play05:13

and now we can start to do things with

play05:15

the embedding to vary it a little bit

play05:17

and and see what the decoder might see

play05:18

if we if we make some mod modifications

play05:20

to the embedding so here I've uh try to

play05:24

kind of blur the embedding and sample

play05:26

some points around the embedding with

play05:27

this this blur radius and you can see

play05:30

the text generated from those blurry

play05:31

embeddings they're a little off like

play05:33

this is not the correct title the

play05:35

title's kind of gone here um the the it

play05:38

still kept the name Greg but it's it's a

play05:40

different person and so there's kind of

play05:42

a blur a semantic blur that's happened

play05:44

here but this is kind of boring this is

play05:46

not really useful what's a little more

play05:48

useful is trying to actually manipulate

play05:49

things in more meaningful directions so

play05:51

now we have the same taste with text and

play05:53

now here I have a bunch of controls so

play05:55

maybe I want to find a direction in this

play05:58

embedding space here computed a

play05:59

direction where if you push an embedding

play06:01

in that direction that's going to

play06:03

represent a shorter piece of text of

play06:05

roughly the same topic and so I picked

play06:07

this direction and I hit go and uh it'll

play06:11

try to move push the embedding of this

play06:13

text in that direction and decode them

play06:14

out and you can tell they're a little

play06:15

bit shorter um if I push it a little bit

play06:18

further even so now I'm taking that

play06:20

shorter Direction and moving a little

play06:21

farther along it and and sampling

play06:24

generating text out of those embeddings

play06:25

again and they're they're even a little

play06:27

bit shorter but they've they've still

play06:28

kept the general kind of idea General

play06:32

topic and uh with that kind of building

play06:34

block you can build really interesting

play06:35

interfaces like for example I can I can

play06:37

plop this piece of text down here and

play06:39

maybe I want to generate a couple of a

play06:40

couple of sort of shorter versions um so

play06:44

this is like a little bit shorter this

play06:46

is even even more short but uh maybe

play06:49

maybe I like this version so I'm going

play06:51

to clone this over here and I'm going to

play06:54

make this the sentiment of the sentence

play06:55

a little more

play06:56

negative and you can start to explore

play06:58

the lat space of of latent space of this

play07:01

embedding model this language model by

play07:03

actually moving around in a kind of spal

play07:04

canvas interface which is is kind of

play07:08

interesting another thing you can do

play07:10

with this kind of end model is now that

play07:11

we have a vague sense that there are

play07:13

specific directions in this space that

play07:14

mean specific things we can start to

play07:17

more directly look at a text and ask the

play07:19

model hey where does this piece of text

play07:22

lie along your length direction or along

play07:24

your negative sentiment Direction so uh

play07:27

this is the original text that we've

play07:28

been playing with it's pretty objective

play07:29

like a Wikipedia style piece of text

play07:31

here I've asked CH PT to take the

play07:33

original text and uh make it sound a lot

play07:35

more pessimistic so uh things like the

play07:38

futile quest for meaning and plunging

play07:40

deeper into the abys of nihilism and uh

play07:42

and if I embed both of these what I'm

play07:44

asking the model to do here is embed

play07:45

both of these things in the embedding

play07:47

space of the model and then project

play07:49

those embeddings down onto each of these

play07:52

directions so one way to read this table

play07:54

is that um this default piece of text is

play07:57

at this point in this negative Direction

play07:59

which by itself doesn't mean anything

play08:00

but it's clearly less than this so this

play08:02

piece of text is much further along the

play08:03

negative sentiment axis inside this

play08:05

model when you look at other properties

play08:07

like how how much um of the artistic

play08:09

kind of topic does it talk about is

play08:10

roughly the same the length is roughly

play08:12

the same um the the maybe the the

play08:16

negative sentiment text is a bit more

play08:18

elaborate in its its vocabulary and so

play08:20

you can start to project these things

play08:21

into these meaningful directions and say

play08:23

what are the features that the model's

play08:25

what are the attributes that the model's

play08:26

um finding in the in the text that we're

play08:28

feeding it

play08:30

uh another way you could test out some

play08:31

of these ideas is by mixing embeddings

play08:33

and so here I'm going to embed both of

play08:35

these pieces of text this one's the one

play08:37

that we've been playing with this one is

play08:39

a beginning of a short story that I

play08:40

wrote once it's about this like town in

play08:42

the Mediterranean uh Coast that's calm

play08:44

and and a little bit old and um both of

play08:48

these have been embedded and so I'm

play08:49

going to say just this is a 2,000

play08:52

dimensional embedding I'm going to say

play08:53

give me a new embedding that's just the

play08:55

first thousand or so Dimensions from the

play08:57

one embedding and then take the last

play08:59

thousand dimensions of the second

play09:00

embedding and just like slam them

play09:01

together and have this new embedding and

play09:04

navely you wouldn't really think that

play09:05

that would amount too much that would be

play09:06

kind of gibberish but actually if you

play09:07

generate some samples from it um you can

play09:09

tell you can see in a bit uh you get a

play09:14

sentence that's kind of a semantic mix

play09:15

of both you have structural similarities

play09:17

to to both of those things like you have

play09:19

this structure where there's a quoted

play09:21

kind of title of a book in the beginning

play09:22

there's topical similarities there

play09:24

structur there's uh punctuation

play09:25

similarities tone similarities and so

play09:28

this is an example of inter

play09:29

in lat space the last I have I have uh

play09:33

you may have seen on Twitter is um about

play09:36

okay I have this un edding model and I

play09:38

have kind of an un edding model that

play09:39

works pretty well can I use this un

play09:41

embedding model and somehow fine-tune it

play09:43

or otherwise adapt it so you can read

play09:45

out text from other kinds of embedding

play09:47

spaces so this is the same sentence

play09:50

we've been using but now when I hit this

play09:51

run button it's going to embed this text

play09:54

not using my embedding model but using

play09:55

open AI Ada text AA 2 uh and then

play09:59

there's a linear adapter that I've

play10:00

trained so that my decoder model can

play10:03

read out not from my embedding model but

play10:04

from open ai's embedding space so I'm

play10:07

going to embed it it's going to try to

play10:09

decode out the text from given just the

play10:11

open AI

play10:12

embedding and

play10:14

uh you can see okay it's not it's not as

play10:18

perfect but there's a surprising amount

play10:19

of detail that we've recovered out of

play10:21

just the embedding with no reference to

play10:23

the source text so you can see this

play10:25

proper noun diaspora it's like

play10:26

surprisingly still in there um this

play10:29

feature where there's a a quoted title

play10:31

of a book is in there it's roughly about

play10:32

the same topic things like the Rogue AI

play10:35

um sometimes when I when I rerun this

play10:37

there's also references to the author

play10:38

where the name is roughly correct so

play10:40

even surprising uh things features like

play10:43

proper nouns punctuation things like the

play10:45

quotes uh General structure and topic

play10:47

obviously those are recoverable given

play10:49

just the embedding because the the kind

play10:51

of deta amount of detail that these high

play10:53

high capacity embedding spaces

play10:54

have but not only can you do this in the

play10:56

text space you can also do this in image

play10:58

space

play11:00

so um here I have a I have a few

play11:02

prepared files um let's start with

play11:06

me and um for dumb technical reasons I

play11:09

have to put two of them in and then

play11:10

let's try to interpolate in this image

play11:12

space so this is now using Clip Clips

play11:14

embedding space I'm going to try to

play11:16

generate say like six images in between

play11:20

uh me and the the notion avatar version

play11:22

of me the cartoon version of me if that

play11:24

back end will warm up cold starting

play11:26

models is sometimes difficult

play11:31

uh there we go so now it's Shing six

play11:34

images bridging kind of interpolating

play11:36

between the photographic version of me

play11:37

and the cartoon version of me uh and uh

play11:40

again it's not perfect but you can see

play11:42

here it's on the left it's it's quite

play11:44

photographic and then as you move

play11:46

further down this interpolation you're

play11:48

you're seeing uh more kind of cartoony

play11:50

features appear here and uh it's

play11:52

actually quite a surprisingly smooth

play11:53

transition um another thing you can do

play11:55

on top of this is you can you can do

play11:57

text manipul as because aul text image

play12:01

model and can

play12:03

say time let's add some text I'm going

play12:07

to subtract the vector for a photo of a

play12:11

smiling man and instead I'm going to add

play12:13

the vector for a photo of a very sad

play12:17

crying

play12:18

man uh and then I'll I'll embid these

play12:20

pieces of text and I empirically I find

play12:22

that for text I have to be a little more

play12:23

careful so I'm going to dial down how

play12:25

much of those vectors I'm adding and

play12:26

subtracting and then generate six again

play12:39

and it's taking a

play12:42

bit okay I'm really

play12:47

sad and you can do you can do even more

play12:49

fun things like you can try to add like

play12:51

here's a photo of a beach I'm going to

play12:53

try to add some some beach in this this

play12:55

time maybe just generate four for a sake

play12:57

of time

play13:00

um or maybe there's a bug and it won't

play13:02

let me

play13:12

generate so in all these demos that I've

play13:14

done both in the text and image domain

play13:16

okay the beach didn't quite survive the

play13:18

uh the lat and space arithmetic but uh

play13:20

in all these all these demos the only

play13:22

thing I'm doing is calculating vectors

play13:24

calculating embeddings for examples and

play13:26

uh and embedding them and just adding

play13:28

them together and some with some

play13:30

normalization and it's surprising that

play13:31

just by doing that you can try to

play13:33

manipulate um interesting features in

play13:34

text and images and with this you can

play13:37

also do things like at style and subject

play13:39

at the same time you can uh this is a

play13:41

cool image that I thought I generated

play13:43

when I my first demo and then you can

play13:44

also do some pretty smooth transitions

play13:46

between landscape

play13:48

imagery

play13:50

so that's interesting um in all these

play13:54

prototypes one principle that I've tried

play13:55

to reiterate to myself is that often

play13:58

times when you're studying this very

play14:00

complex sophisticated um models you

play14:04

don't really necessarily have the

play14:05

ability to look inside and say okay

play14:06

what's what what's happening not even

play14:07

get an intuitive understand even getting

play14:09

an intuitive understanding of what is a

play14:10

model thinking what is a model looking

play14:12

at can be difficult and I think these

play14:13

are some of the ways that I've tried to

play14:14

render the these invisible parts of the

play14:16

model a little bit more visible to let

play14:18

you more a little bit more directly

play14:20

observe exactly what the model is um the

play14:23

representations the model is operating

play14:24

in and sometimes you can also take those

play14:26

and directly interact or let directly

play14:29

interact with the representations to

play14:31

explore what these faes

play14:33

represent um and I think there's there's

play14:35

a ton of interesting pretty

play14:37

groundbreaking research that's happening

play14:38

here um on the left here is the AO World

play14:40

model paper which is fascinating neurons

play14:42

on a hyack and then on the right is very

play14:45

very recent I had to add this in last

play14:47

minute because it's super relevant um in

play14:49

a lot of these examples I've calculated

play14:50

these feature Dimensions by just giving

play14:52

examples and calculating centroids

play14:54

between them but here anthropics new

play14:56

work along with other work from

play14:57

conjecture and other labs have found

play14:58

unsupervised ways to try to

play15:00

automatically discover these Dimensions

play15:01

inside models so that's super exciting

play15:02

and in general I'm really excited to see

play15:04

latent spaces that appear to encode you

play15:07

know by some definition interpretable

play15:09

controllable representations of the

play15:10

models input and output um I want to

play15:13

talk a little bit in the last few

play15:14

minutes about the models that I'm using

play15:16

the text model is a custom model um I

play15:18

won't talk I won't go into too much

play15:19

detail but it's fine-tuned from uh T5

play15:21

checkpoint with as a d using Auto

play15:23

encoder it's an incoder decoder

play15:24

Transformer with some modifications that

play15:26

you can see in the code um so here's a

play15:29

general Transformer incoder on the left

play15:31

decoder on the right I have some pooling

play15:32

layers to get an embedding this is like

play15:34

a normal T5 embedding model stack and

play15:36

then on the right I have this special

play15:38

kind of gated layer that pulls from the

play15:40

embedding to uh to decode from the

play15:43

embedding you can look at the code it's

play15:44

a little more uh easy to understand but

play15:47

we take this model and we can adapt it

play15:48

to other models as well as you saw with

play15:50

the open AI embedding recovery and so on

play15:53

the left is the normal trading regime

play15:54

where you have an encoder you get an

play15:55

embedding and you try to reconstruct the

play15:57

text on the right we just just train

play15:58

this linear adapter layer to go from

play16:00

embedding of a different model to then

play16:03

reconstruct the text with a normal

play16:05

decoder um and today I'm excited to

play16:08

share that these models that I've been

play16:09

deing with uh that you may have asked

play16:11

about before are open on hogging face so

play16:13

you can go download them and try them

play16:14

out now uh these are the links on the

play16:16

left is the hug face models and then

play16:18

there's a collab notebook that lets you

play16:19

get started really quickly try to do

play16:21

things like interpolation and

play16:22

interpretation of these features and so

play16:24

if you find any interesting results with

play16:26

these please let me know and and if you

play16:28

have any questions also reach out and

play16:29

I'll be able to help you out the image

play16:31

model that I was using at the end wasow

play16:33

brain Carlo excited to see Korea um

play16:36

stepping out there in this model this

play16:38

model is an uncp model which is trained

play16:40

kind of like the way that Dolly 2 was

play16:42

trained as a diffusion model that's

play16:43

trained to invert clip embeddings so go

play16:45

from clip embeddings of images back to

play16:47

text and that lets us do similar things

play16:49

as the text model that that we

play16:51

used in all these prototyping I think a

play16:54

general principle if if you have one

play16:56

takeaway from this talk it's that when

play16:58

you're working with with these really

play16:58

complex models and kind of inscrutable

play17:01

pieces of data if you can get something

play17:03

into a thing that feels like it can fit

play17:04

in your hand that you can play with that

play17:06

you can concretely see and observe and

play17:08

interact with can be directly

play17:09

manipulated visualized all these things

play17:11

all the tools and prototypes that you

play17:13

can build around these things I think

play17:14

help us get a deeper understanding of

play17:15

how these models work and how we can

play17:17

improve them

play17:19

um and in that way I think models

play17:21

language models and image models

play17:22

generation generative models are a

play17:24

really interesting laboratory for

play17:26

knowledge for studying how these how

play17:28

these um different kinds of modalities

play17:30

can be represented and um Brett Victor

play17:33

said the purpose of a thinking medium is

play17:35

to bring thought outside the head to

play17:37

represent these Concepts in a form that

play17:38

can be seen with the senses and

play17:40

manipulate with the body in this way the

play17:42

medium is literally an extension of the

play17:44

mind and I think that's a great poetic

play17:46

way to kind of describe the the

play17:48

philosophy that I've approached a lot of

play17:49

my prototyping with so if you follow

play17:53

some of these principles and try to dig

play17:54

deeper in what the models are actually

play17:55

looking at build interfaces around them

play17:57

I think more human interfaces to

play17:59

knowledge are possible I'm really

play18:00

excited to see that

play18:02

future thank

play18:06

[Applause]

play18:13

you