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!"
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 TurnSnake 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"Let's play Snake's memory game!
I'm going to give you a sequence. Try to remember it:
- Red
- Blue
- Red
- Green
- Blue
- Yellow
- Red
- Blue
- Green
- 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..."
"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
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?
- Usually, you remember the FIRST word (Apple) and the LAST word (Goat) best!
- The middle ones (Door, Egg, Fish) are harder! Experiment 2:
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:- Words in a sentence (order matters!)
- "Dog bites man" vs "Man bites dog" - totally different!
- Notes in music (sequence creates the melody!)
- Do, Re, Mi, Fa... order creates the song!
- Steps in a recipe (must follow in order!)
- Mix flour, THEN add eggs, THEN bake
- Wrong order = disaster!
- Stock prices over time (sequence shows the trend!)
- $10, $12, $15, $13... going up? down? Where Snake (RNN) is used:
- Simple text prediction
- Basic time series analysis
- Short sequence processing But Snake has been mostly REPLACED by better animals!
(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:- Simple sequence tasks
- Short-term predictions
- Basic pattern following WEAKNESS:
- Forgets information from long ago
- Can only handle sequences of ~10-20 steps well
- Gets confused with long-term dependencies REAL-WORLD JOBS:
- Basic text prediction (but LSTM and Transformer do it better)
- Simple time-series analysis
- Mostly replaced by better methods now! FUN FACT: Snake is like the grandparent of modern AI! She paved the way for Elephant (LSTM) and Lion (Transformer)! REMEMBER ME: "I'm good at short sequences, but for long ones, call Elephant or Lion!"
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!"
Why is it important to honor "older" technology even if newer technology is better?
- Old technology taught us important lessons!
- It paved the way for improvements!
- Understanding history helps us appreciate progress!
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...