0% found this document useful (0 votes)
261 views72 pages

Transformer - Poetry 978 1 7341647 0 1 PDF

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 72

transformer

poetry

i
ii
transformer
poetry
Poetry classics reimagined by artificial intelligence

Kane Hsieh

Making Uncommon Knowledge Common


Paper Gains Publishing
iii
Copyright © 2019 by Paper Gains Publishing.

All rights reserved. No portion of this book may be reproduced in any form without
permission from Paper Gains Publishing, except as permitted by U.S. copyright law.

Paper Gains Publishing


228 Clipper Street
San Francisco, CA 94114
papergainspublishing.com

Printed in the United States of America

iv
To Dr. William Weitzel, who mercy-graded me a “B” in
writing class a decade ago.

v
I’ve come up with a set of rules that describe our reactions to technologies:

1. Anything that is in the world when you’re born is normal and ordinary and is
just a natural part of the way the world works.

2. Anything that’s invented between when you’re fifteen and thirty-five is new and
exciting and revolutionary and you can probably get a career in it.

3. Anything invented after you’re thirty-five is against the natural order of things.

– Douglas Adams

vi
Table of Contents

Foreword ix
Preface xi
Introduction xiii

Ozymandius 1
One Art 3
The Road Not Taken 5
Where the Sidewalk Ends 6
Because I could not stop for Death 9
Inferno, Canto I 11
In Flanders Field 13
O Captain! My Captain! 15
Howl 17
The Tyger 19
Outsight 21
Zuang Zhou Dreams of Being a Butterfly 23
Sonnet 18 25
Oh, the Places You’ll Go! 27
The Hollow Men 29
The Summer Day 31
A Just-Finishing Candle 33
A Psalm of Life 35
Still I Rise! 37
The Second Coming 39
Do not go gentle into that good night 41
Kubla Khan 43
Edge 45
The Raven 47
There Will Come Soft Rains 49
The Lorax 51
vii
viii
Foreword

I was asked to write the foreword for this poetry book, but since I was
a co-author on the GPT-2 paper, I’ll let it do the heavy lifting:

The title is very fitting, I think, since the project I had in mind was the
synthesis of my two fields of study. My focus is on the science of how
our bodies and brains are wired so that it can be turned around to find
patterns that make sense.

In my experience, there are two things I’ve learned from my work in


science ­— there are things that are obvious to those not directly in-
volved, and more subtle things that are harder to notice.

– David Luan

ix
xkcd Comic #1263: “Reassuring”

x
Preface

The first time I witnessed GPT-2 (Generative Pretrained Transformer


2), the artificial intelligence model used to synthesized the poetry in
this book, I was reminded of xkcd Comic #1263: “Reassuring”1 (op-
posite page). Since then, I have seen GPT-2 create prose, but never
poetry–that was the inspiration for this book.

First and foremost, thanks to my friend David Luan for co-authoring


the paper Language Models are Unsupervised Multitask Learners. GPT-2
was first revealed to the world in this groundbreaking paper.

The creation of this book was streamlined by Talk to Transformer2,


which makes the largest publicly-released model of GPT-2 easy to
experiment with. Thanks goes to its creator, Adam King.

Kevin Kwok and Keila Fong provided encouragement for this project
as only close friends can. Bored one day, I texted them screenshots
from GPT-2 riffing on Ozymandias and The Road Not Taken; they were
relentless in egging me on to take a half-baked joke to a fully-baked
book. Chase Hu is as well-read of a friend one could hope for, and I
appreciate his taste and infinite patience in lending me poetry books.

My goal with this book is to share the whimsical results of mashing


together two disjoint fields. This book is not meant to have any scien-
tific or literary value.

– Kane Hsieh

1 www.xkcd.com/1263
2 www.talktotransformer.com
xi
xii
Introduction

Transformer Poetry includes twenty-six poems that I think most people


will have read or at least have heard of. If you haven’t, I strongly suggest
putting this book down and reading every poem here in its original
form first.

The opening stanzas of each poem were read by GPT-2, which then
synthesized additional stanzas to create new hybrid poems. The resul-
tant poems are published in the book, and can be read in this way:

The opening stanzas of each poem


are preserved in their original meter,
and printed semibold;

GPT-2’s response then follows, printed normally;


minor typesetting is done to better match meter–
but the text is mostly left untouched,
as the model intended.

Enjoy: poetry by a transformer.

xiii
transformer
poetry
Poetry classics reimagined by artificial intelligence
Ozymandias
Percy Bysshe Shelley

I met a traveller from an antique land,


Who said—“Two vast and trunkless legs of stone
Stand in the desert. . . . Near them, on the sand,
There are many tracks. And, in the distance, and all alone,
I saw, far below me, what I thought was the sea.
But they are the tracks of man, which never die,
And I have no power to turn them to account.
The road I took, I know well,
The journey took me in vain, the course I took,
To get here and back again.
And here again, for evermore,
I look up at the sea and I say to myself,
“There are no other lands; there is no other time;
There are no other souls.””

1
2
One Art
Elizabeth Bishop

The art of losing isn’t hard to master;


so many things seem filled with the intent
to be lost that their loss is no disaster.
but a true disaster is that we
only lose ourselves.

3
4
The Road Not Taken
Robert Frost

Two roads diverged in a yellow wood,


And sorry I could not travel both
And be one traveler, long I stood
And looked down one as far as I could
To where it bent in the undergrowth;

The other was longer and I never went


To the other, for I had found
That I was alone in my misery.
And here I sit, sad and lonely,
Staring to see what has become

Of one who once was happy and loved,


Now so miserable at heart. And at last I go
The other way, the highway no longer holds
The other lonely road, it closes forever,
The one lonely road I was never on,

I must go back, I must try again,


I must see if I can find a way on
The lonely highway of my life.

5
Where the Sidewalk Ends
Shel Silverstein

There is a place where the sidewalk ends


And before the street begins,
And there the grass grows soft and white,
And there the sun burns crimson bright,
And there the moon-bird rests from his flight
To cool in the peppermint wind.

Here the trees sway in the cool shade


With a soft sigh of the night and the night
Of eternity.

From the porch the children, each at a different door


To one another, the little ones, the small ones
Who can neither talk nor play,
But can just stare into the sky,
And the stars come down, and they all say:
“Come on, come on, come on.”

6
So we walk, until we arrive
At the door of the little house.
Little boy stands with his arm at the door,
Staring at us,
Like the moon over the deep blue sea.

Little girl, at the other end of the garden


Sits like an ancient tomb,
And little boy, standing behind her, has
His back turned. They are silent.

7
8
Because I could not stop for Death
Emily Dickinson

Because I could not stop for Death –


He kindly stopped for me –
The Carriage held but just Ourselves –
And Immortality.

That was all, a very solemn moment with a very brave mind.
The sun fell on us, we were left behind,
the world went dark –
Our only light was the moon –
And we were still there.

9
10
Inferno, Canto I
Dante Alighieri (Longfellow Translation)

Midway upon the journey of our life


I found myself within a forest dark,
For the straightforward pathway had been lost.

I saw the first glimmering


Of an oasis in the midst of the night.
I was not alone – yet it was difficult to trust.

I saw my father come forth, carrying a child in his arms.


They were close – and not very far ahead.
As I listened, I felt a weight fall on my shoulders.

A strange sense of doom enveloped me,


and for a moment I seemed to think I died.
I could still hear my father saying “I will go with you.”

I heard a great gong and it echoed through the forest:


“I will go with you. I have done what I could.”
I looked back – there was my brother in the shadow of the tree,
a shadow his own eyes might cast from the tree’s branch.

He looked me up and down – and spoke.

11
12
In Flanders Field
John McCrae

In Flanders fields the poppies blow


Between the crosses, row on row,
That mark our place; and in the sky
The larks, still bravely singing, fly
Scarce heard amid the guns below.

They say the earth in Flanders, on the hill which is


Ethereal, the world that is, rests
On the heads of the poppies.
Their song is an echo of the earth
Of my mother and father and all my brothers.

Where can I go, that I may see these flowers


And hear the larks the same as the others,
Where have I lost my place?
I look, too, for the sky, and the larks are
Scarce heard in the great black clouds,
Of the poppies.

They say I was born here of one mother,


And she died here, as the sun has done here
The earth and all the earth below.

13
14
O Captain! My Captain!
Walt Whitman

O CAPTAIN! my Captain! our fearful trip is done;


The ship has weather’d every rack, the prize we sought is won;
We have no more enemies, yet a fleet of hostile ships,
The land is a prey to everyone, a prey to all;

We have now no hope of escape, we cannot swim;


No power has any place to turn away our fate.
It is over.

My Captain: Captain! it was an honor to meet you.


A mighty warrior, your name is good, the name of Dromund Kaas,
In these troubled and perilous times,
Where no one has any place to turn, the brave shall rise,

To sail in the name of R’lyeh, the brave’s name:


To go among the winds, to sail our long, great way.
Yes, our long, great way.

Well, that word is mighty honorable,


he proud name of R’lyeh the World-Order,
To sail on the long, great way to the land of the free.

15
16
Howl
Allen Ginsberg

I saw the best minds of my generation destroyed by madness,


starving hysterical naked,
dragging themselves through the negro streets at dawn looking for
an angry fix,

The madman’s hands, the maniac’s mind, the mind that takes
nothing human
as an object of delight, and the lunatic’s body, or any other
living thing for the time...

And so I looked. I walked in a kind of cold madness through


streets I knew,
and I felt the mad passion of human weakness and decay;

I felt it so well that I did not feel much. I stood here, this evening,
when the streets
were dead still with the sound, I stood up at last.

17
18
The Tyger
William Blake

Tyger Tyger, burning bright,


In the forests of the night;
What immortal hand or eye,
Could frame thy fearful symmetry?

And with burning eyes it burned,


To the flames, to the flames, to the flames,
Burnished with flames to the hills,
Flames.

And the burning flames


Burned, and the blaze, burning flaming flame of
Ether and lead and silver and wood
And the flame of fire is not burnt,

It burns, and in all its flame the flame of fire


Burns from eternity to eternity.

19
20
Outsight
Ursula Le Guin

I’m half unseen,


to me, my skin
a screen to all within.
There will be a world
where I am unappreciated,
but I will not leave in peace,
I’ll make my mark there
and it will stand as a mark
to remember my struggle
until the day I die.

21
22
Zuang Zhou Dreams of Being a Butterfly
Zhuangzi (Watson translation)

Once, Zhuang Zhou dreamed he was a butterfly, a butterfly flitting


and fluttering about, happy with himself and doing as he
pleased. He didn’t know that he was Zhuang Zhou’s shadow
and this shadow had no other name.

It was just there invisible to all except for the people with ears to
hear it. It seemed like they were talking about how he was the
best of them.

However, he knew they wanted to beat him. It was too late to change
back now. Some of his shadow fluttered about and danced,
giving his face a slightly strange look.

He was not a handsome butterfly.

23
24
Sonnet 18
William Shakespeare

Shall I compare thee to a summer’s day?


Thou art more lovely and more temperate:
Rough winds do shake the darling buds of May,
And summer’s lease hath all too short a date;
And the grass is green and the trees are full of fruit’.
And, when the sky is blue and the heat is blazing,
And the rain is falling upon the fields and the trees,
But the sun is downcast as when it is rising,
And the sky is covered with clouds and the land is shrouded by fog,
And the sky is not bright to behold yet:
Thou hast not a thousand days to tell me thou art beautiful.

25
26
Oh, the Places You’ll Go!
Dr. Seuss

Congratulations!
Today is your day.
You’re off to Great Places!
You’re off and away!
Let the journey begin!
You’re running from The Devil in the Dark!
It’s time to begin your journey...
You’re on the road to greatness.
You’re running from the Dark Realm,
out of the world itself !
The road goes on forever...

27
28
The Hollow Men
T.S. Eliot

We are the hollow men


We are the stuffed men
Leaning together
Headpiece filled with straw. Alas! the straw is long gone.
My mind is broken, the straw is gone,
And it is gone forever.

The straw has fallen off


“You must be the stork”
So says the man at the door
“The storks, they look for that”
But the storks are nothing.
There is no stork.

And the straw is long gone.


My mind is broken, the straw is gone
And it is gone forever.

29
30
The Summer Day
Mary Oliver

Who made the world?


Who made the swan, and the black bear?
Who made the grasshopper?
Who made the elephant?
Who made the cobra?
Who made the cat?
Who created the sea?
Who created the air?
Who made the tree?
The sea and the grasshopper are only the fruits
which are the works of God.
But the elephant, the cobra, and the cat are
created by human hands.
I think that the cat is made by human hands.

31
32
A Just-Finishing Candle
Jalāl ad-Dīn Muhammad Rūmī (Barks translation)

A candle is made to become entirely flame.


In that annihilating moment
it has no shadow.

A flame is made in a single candle


like a blade.
The flame is the same for all,
no exceptions.

I am that candle.
When I look at the world
I see an eternal fire which runs
from star to star.

33
34
A Psalm of Life
Henry Wadsworth Longfellow

Tell me not, in mournful numbers,


Life is but an empty dream!
For the soul is dead that slumbers,
And things are not what they seem.

A dream of a dream,
Shall never wake the sleeping soul.
For we are but shadows and shadows
This is the soul’s home, and all things are there.

The one who lives can never die.


A true king is that whose throne is in the grave.
The soul has nothing else except death
And the body’s dissolution, for it will not pass away.

35
36
Still I Rise!
Maya Angelou

You may write me down in history


With your bitter, twisted lies,
You may trod me in the very dirt
But still, like dust, I’ll rise.

I will speak, because my voice shall be heard.


I will sing, because my voice shall be heard, and my song be sung.
I will dance, because my dance shall have no end
And my words shall be spoken, because my words shall have no end.

I will cry, because my tears shall have no end


And my voice shall be made immortal.

37
38
The Second Coming
William Butler Yeats

Turning and turning in the widening gyre


The falcon cannot hear the falconer;
Things fall apart; the centre cannot hold;
Mere anarchy is loosed upon the world,
Till chaste order vanishes, all is confusion.
It is not the Will but the Power that is at work;
The strong man is he who knows how to use it.
It is not the Will but the Power that makes
Power out of nothing.

39
40
Do not go gentle into that good night
Dylan Thomas

Do not go gentle into that good night,


Old age should burn and rave at close of day;
Rage, rage against the dying of the light.

Be fierce, oh! be fierce in wrath,


For every old age is mad; all things do wrong.
Rage, rage against the dying of the light.
The end cometh quickly, but the means runneth out.

41
42
Kubla Khan
Samuel Taylor Coleridge

In Xanadu did Kubla Khan


A stately pleasure-dome decree:
Where Alph, the sacred river, ran
Through caverns measureless to man
Down to a sunless sea.

A princely palace, of marble walls


Where the kings of man did dance
When the dark gods rose up in rage
To strike those who dwelt far away,
To strike the gods themselves who ruled
Of the world in blood!

The land was a desert


And the sand on the sky red and blue.
But the wind howled, “Ah, where is his majesty now?”
The king’s palace was cold and empty in the morning,
as it has always been,
and the king’s great golden throne sat there cold and empty,
like a grave in a graveyard.

The prince was gone, his great golden throne sat cold and
empty and alone.
It was the wind that cried, “Now this is Kubla’s palace;
now, he shall be my king.”
43
44
Edge
Sylvia Plath

The woman is perfected.


Her dead

Body wears the smile of accomplishment,


The illusion of a Greek necessity

To the unappeased
I sing “Pleasure is an illusion”

There is no salvation for me


But to seek the real and the unfathomed

To the Unconquered
I sing “Unconquered”

The last words of a man-made civilization


Are the words: “We are free”

In the land of your birth we will find


The truth we seek

45
46
The Raven
Edgar Allan Poe

Once upon a midnight dreary, while I pondered, weak and weary,


Over many a quaint and curious volume of forgotten lore—
While I nodded, nearly napping, suddenly there came a tapping,
As of someone gently rapping, rapping at my chamber door.

I sprang to my feet, and at once rose to answer,


When in the midst of all the rattling I beheld,
That the visitor was not an unwelcome guest,
But the friend of many a furtive night of want.

And now the man who knocks at my door, in the glow of day,
Is surely my neighbor, for one day I sat by his side,
And the next, he was as me: and at each new moon
He would sit down again and take my arm;

And whenever he spoke, it was a charm,


which, with a flick of the hand, had all the magic
Of music, or the charm of poetry.

47
48
There Will Come Soft Rains
Sara Teasdale

There will come soft rains and the smell of the ground,
And swallows calling with their shimmering sound;

The birds will sing the song of their country


Till the sky is full of a thousand splendors
And every bird in the tree-tops are sing’d.

All the hills, the fields, and valleys will shake,


Breathless with joy; the streams will run,
And with the thunder of their sounds the earth will shake;

The grass will rise up and the wild beasts of the field
With the noise of their rushing they will run.

49
50
The Lorax
Dr. Seuss

I am the Lorax who speaks for the trees


which you seem to be chopping as fast as you please!
BANG!
BANG!
BANG!
BANG!

51
52
About the Authors

“GPT-2 is a large transformer-based language model with 1.5 billion


parameters, trained on a dataset of 8 million web pages. GPT-2 is
trained with a simple objective: predict the next word, given all of the
previous words within some text. The diversity of the dataset causes
this simple goal to contain naturally occurring demonstrations of many
tasks across diverse domains. GPT-2 is a direct scale-up of GPT, with
more than 10X the parameters and trained on more than 10X the
amount of data.”1

Kane Hsieh is a large male human also trained on a dataset of 8 mil-


lion web pages.2

1 www.openai.com/blog/better-language-models
2 www.kane.pizza
53

You might also like