🐍 Chapter 2

Snake - The Path Follower

Understanding Basic Sequential Memory (RNN)

The Winding Path Challenge

The animals looked at the map. It showed a twisting, turning path through the forest with MANY turns - left, right, left, straight, right, left, right, right, left...

"Goodness!" said Ella. "How will we remember all those turns?"

From the bushes, they heard a gentle "Hisssss..."

A beautiful green Snake slithered out, her scales shimmering in the sunlight.

"Hissss... hello, friendsssss," she said. "I am Snake, and I am good at following pathsssss and remembering sequencesss!"

⏸️ Pause & Think!

Before learning about Snake's power, try this:

Can you remember a phone number someone just told you? How about remembering it 5 minutes later? How about the FIRST phone number you heard today after hearing 10 more?

This is about MEMORY - and we're about to learn how Snake remembers!


Snake's Power: Sequential Memory

"Let me show you how I work," said Snake, coiling up comfortably.

"Unlike Eagle, who looks at everything all at once, I experience things ONE AT A TIME, IN ORDER."

She pointed to the path. "Watch..."


How Snake Follows a Path

STEP 1: The First Turn

Snake approached the path. The first instruction said: "Turn LEFT"

Snake's brain:

Current memory: (empty)

New information: "left"

Updated memory: "left"

Snake thinks: "Okay, I remember: LEFT"

Snake turned left and slithered forward.


STEP 2: The Second Turn

The path showed: "Turn RIGHT"

Snake's brain:

Current memory: "left"

New information: "right"

Updated memory: "left, then right"

Snake thinks: "Okay, I remember: LEFT, then RIGHT"


STEP 3: The Third Turn

The path showed: "Turn LEFT again"

Snake's brain:

Current memory: "left, right"

New information: "left"

Updated memory: "left, right, left"

Snake thinks: "I remember: LEFT, RIGHT, LEFT"

This continued as Snake slithered along...

Step 4: Straight β†’ Memory: "left, right, left, straight" Step 5: Right β†’ Memory: "left, right, left, straight, right" Step 6: Left β†’ Memory: "left, right, left, straight, right, left"
🎨 Try This Activity!

Let's play Snake's memory game!

I'm going to give you a sequence. Try to remember it:

  1. Red
  2. Blue
  3. Red
  4. Green
  5. Blue
  6. Yellow
  7. Red
  8. Blue
  9. Green
  10. Yellow

Now, WITHOUT looking back, can you remember all 10 in order?

Hard, right? That's Snake's challenge!

Snake's Problem: Forgetting the Beginning

Snake continued down the path, but something happened...

After 15 turns, Snake's memory:

"...straight, right, left, straight, right, left, right, straight, left"

Snake: "Wait... what was the FIRST turn? Was it left or right?"

"I remember the recent turns clearly, but the beginning is foggy..."

Snake explained sadly: "You see, I have a weakness. I can remember things ONE AT A TIME, moving forward. But when the sequence gets LONG - like 20 or 30 or 50 steps - I start to FORGET the early ones!"

"It's like..." Snake tried to think of an example, "...imagine someone telling you a really long phone number: 9-1-7-3-2-5-6-1-9-4-8-3-7-2-1-9-5"

"By the time you hear '5' at the end, do you remember the '9' at the beginning?"

The animals shook their heads.

"Exactly!" said Snake. "That's my problem!"


Why Does Snake Forget?

Professor Encoder stepped in to explain.

"Snake has what we call SHORT-TERM SEQUENTIAL MEMORY."

"Let me show you what happens inside Snake's brain..."

TURN 1: [LEFT stored in memory]

TURN 2: [LEFT] β†’ Process β†’ [LEFT, RIGHT stored in memory]

TURN 3: [LEFT, RIGHT] β†’ Process β†’ [LEFT, RIGHT, LEFT stored]

...this continues...

TURN 15: [...Fuzzy..., LEFT, RIGHT, STRAIGHT, LEFT, RIGHT...]

↑

The beginning is getting fuzzy!

TURN 30: [Completely forgotten, ..., ..., LEFT, RIGHT, LEFT]

↑

Only remembers the last ~10 turns clearly

The technical reason: Each time Snake processes new information, the old information gets a little weaker. It's like a photograph that fades over time!
⏸️ Pause & Think!

This is like human memory too! Try this:

Experiment 1:

Read this list once: Apple, Book, Car, Door, Egg, Fish, Goat

Now close your eyes. Which words do you remember BEST?

Now try to remember 20 words. Same thing happens - the middle gets fuzzy!

That's Snake's challenge when paths get long!


Snake's Attempt at the Path

Snake tried to follow the winding path. It had 47 turns!

TURNS 1-10: Snake remembers perfectly! βœ“

"Left, right, left, straight, right, right, left, left, straight, right"

TURNS 11-20: Still pretty good! βœ“

"Left, straight, right, left, right, left, straight, right, right, left"

TURNS 21-30: Getting harder... ⚠️

"Straight, left... wait, what came before straight again?"

TURNS 31-40: Very difficult! ❌

"Right, left... I think? The earlier turns are really fuzzy now..."

TURNS 41-47: Snake is lost! ❌

"I remember these last few turns: straight, left, right, left, straight, right, left"

"But what were turns 1-10? I can't remember!"

Snake had to stop, defeated.

"Hissss... I'm sorry, friendsssss. The path is too long for me. I can only remember about 10-15 steps clearly..."


What Snake Represents in the Real World

Professor Encoder nodded sympathetically. "Snake represents what we call RNN - Recurrent Neural Network!"

"RNN was one of the first types of AI that could handle SEQUENCES - things that come in ORDER."

Real-world examples of sequences:
  1. Words in a sentence (order matters!)
  1. Notes in music (sequence creates the melody!)
  1. Steps in a recipe (must follow in order!)
  1. Stock prices over time (sequence shows the trend!)

(Don't worry, we'll meet them soon!)


🐍 Snake's Stat Card

REAL NAME: Recurrent Neural Network (RNN) INVENTED: 1986 SUPERPOWER: Sequential memory (but only short-term!) BEST FOR:

Snake's Important Role

"Don't feel bad, Snake!" said Professor Encoder kindly. "You were REVOLUTIONARY when you were invented!"

"Before you, computers couldn't handle sequences AT ALL!"

"You showed the world that AI could process things in ORDER - words, music, time-based data!"

"You're like the pioneer who opened the path for others to improve on!"

Snake smiled. "Thank you, Professor. I may not be the best anymore, but I'm proud of what I contributed!"

⏸️ Pause & Think!

Why is it important to honor "older" technology even if newer technology is better?


Time for an Upgrade!

"So," said Monty the Monkey, "if Snake can't handle this long path, what do we do?"

Professor Encoder smiled mysteriously. "We call Snake's UPGRADED cousin!"

"Who?" asked the animals.

"The one who NEVER forgets!"

Professor Encoder trumpeted loudly.

From behind the trees, they heard heavy footsteps...

THUMP. THUMP. THUMP.

Someone VERY large was approaching...

(Continue to Chapter 3 to meet Elephant!)


To be continued in the next part...