Midnight Selfie Video 'My Friends' Breaks All the Boundaries - The Insta Algorithm & AI
| By Abhishek Dey & Harsh Chheda | August 7, 2026 | Level 200 | ORCID: 0009-0006-5427-7058 |
The Algorithm
The word “algorithm” traces back to the 9th-century Persian mathematician al-Khwarizmi, but the concept is far older. Ancient India gave the world some of the earliest known algorithms: Panini’s grammar rules (4th century BCE) were essentially a formal language parser, Aryabhata’s step-by-step methods for square roots and planetary positions were computational procedures, and the Euclidean-style algorithms in Sulba Sutras predate Greece.

Today, the same idea, a finite sequence of instructions that transforms input into output, decides which of 2.5 billion people sees which video at 11 PM.
New Delhi, 11:50 PM IST. Selfie Video. Upwards, Onwards. World Record.
A few nights ago, a selfie video pops up on Instagram around 11:50 PM IST, addressed directly to India’s GenZ. No studio, no production crew, just a message to the young generation. By morning, it had shattered every engagement record the platform has ever seen. Fastest to 10 million views, highest like velocity in a single hour, most shared Reel in Indian Instagram history. The selfie reel crossed 303 million views within 24 hours, shattering the previous 24-hour record of 300 million views held by streamer IShowSpeed and BTS. It crossed every algorithmic boundary Instagram has: seed followers, topic clusters, Explore page, global Reels feed, and spilled into WhatsApp forwards, X reposts, and YouTube reactions. I watched the numbers climb in real-time. And as an AI researcher, I wanted to understand what Instagram’s algorithm actually did at 11:51 PM. How a single upload cascaded into hundreds of millions of impressions in hours, what boundaries it crossed, in what order, and what signals triggered each expansion. Whether this was pure organic amplification or invisible layers intervened. This isn’t a post about who uploaded the video. This is a systems engineering dissection of how Instagram’s recommendation engine operates at maximum capacity.
Everything Breaks All the Time, But Not Scale
Instagram processes 95 million photo and video uploads every single day. Each upload triggers a cascade: image resizing, video encoding, content classification via computer vision, embedding generation, safety checks, storage replication, CDN distribution, and notification fan-out. All within seconds. Components fail constantly at this scale, disks die, network partitions happen, services crash, but the architecture doesn’t prevent failure, it absorbs it, and that’s what makes it resilient.
2.5 billion monthly active users
500 million+ daily Stories
95 million+ photos/videos uploaded daily
4.2 billion+ likes per day
~1 million requests/second to backend
200+ microservices
5 data centers globally
Stranger Things: Chronological Feed vs Algorithmic Feed
Until June 2016, Instagram displayed every post in strict reverse-chronological order. Then Instagram introduced algorithmic ranking, and the creator ecosystem shifted overnight. Instagram’s justification: users were missing 70% of posts from accounts they followed. In 2022, after sustained backlash, Instagram reintroduced a “Following” tab that preserves chronological ordering, but the default home feed remains algorithmically ranked.

This is where it gets interesting. Pre-2016, Instagram showed posts newest-first. A single SQL query decided your entire feed:
SELECT * FROM posts
WHERE author_id IN (user's following list)
ORDER BY created_at DESC
LIMIT 50
Simple. Transparent. Fair. But it broke down at scale. Heavy users followed 500+ people and missed important posts. In 2016, they switched to algorithmic ranking:
score = f(
user_interest_in_author,
post_type_preference,
recency,
post_quality_signal,
content_similarity,
relationship_strength,
diversity_penalty
)
The shift from chronological to algorithmic gave Instagram over 200% more engagement. The posts were the same. Only the ordering changed. The ranking function matters more than the raw data.
The Journey Of a Post: Seed, Amplify, Reach
Most people assume that when you hit “post,” your content instantly reaches all your followers. It doesn’t. Instagram treats every upload as an experiment. It shows your content to a small controlled group first, measures how they react, and only then decides whether the rest of the world deserves to see it. Your post has to earn its reach:
Phase 1 (0-30 minutes): Seed Audience: Shown to 5-10% of your followers, but not randomly. These are your most predictable audience, followers who consistently engage with your posts, who interacted with your recent content, and who are active on the app at that moment. If even they don’t engage, it’s a strong negative signal. The platform watches completion rate, like velocity, share/save rate, and skip rate.
Phase 2 (30 min - 6 hours): Algorithmic Amplification: If the seed audience engaged above the creator’s historical average, the post expands to remaining followers. If below average, the post dies.
Phase 3 (6-24 hours): Discovery Surfaces: Strong-performing posts enter the Explore page and Reels feed, competing against all creators globally. Purely content-matching based on embeddings, zero connection to your follower graph.
Key difference: TikTok is algorithmic from second one (shows to random strangers immediately). Instagram seeds to followers first, then expands. This is why a zero-follower account can go viral on TikTok but rarely on Instagram.
How the Algorithm Understands Video Content

The algorithm doesn’t rely on hashtags, those are the weakest signal contributing less than 5% to ranking weight (Mosseri, 2022). It watches your video. Instagram samples 1 to 3 frames per second through vision transformers that detect objects, classify scenes, recognize actions, and score quality across 1500+ visual categories. The audio track is transcribed, fingerprinted to identify songs from a database of over 100 million tracks, and checked against trending sounds. On-screen text is extracted via OCR, captions parsed through NLP. Beyond individual signals, the system attempts to understand intent: is this educational, entertainment, a product review, a personal story? All signals compress into a single high-dimensional content embedding vector, the video’s permanent identity in the recommendation system. When a user opens their feed, their interest embedding is compared against candidate video embeddings using cosine similarity, scoring over 1000 candidates in under 200 milliseconds. The strongest signal remains user behavior: who watched, who skipped, who shared. Computer vision is critical for cold-start when a new video has zero engagement data, which accounts for roughly 20% of all content shown on Explore. The entire classification pipeline runs within seconds of upload, meaning by the time the first follower sees the post, Instagram already knows what it’s about better than the creator’s caption could ever describe. This is why videos with zero hashtags still go viral, the machine doesn’t need you to tell it what your video is about, it already knows.
The Role of AI in Instagram’s Scoring System
Instagram runs multiple neural networks simultaneously: one predicts likes, another predicts comments, a separate model estimates watch time, yet another predicts shares. These are deep learning models trained continuously on billions of data points, updated in near real-time. The AI doesn’t just rank content, it understands content. Computer vision transformers analyze frames, NLP models process text, audio models identify sounds. All merge into a unified content embedding matched against user interest embeddings to predict relevance. The model is the same for everyone, but the input is unique to each user, which means two people opening Instagram at the same time see completely different feeds, even if they follow the exact same accounts.
The Scoring System: No Single Score Exists
There is no universal “this video scored 8.5” stored anywhere. Every score is a per-user prediction computed in real-time:
predict_engagement(USER_A, VIDEO_X) = 0.87
predict_engagement(USER_B, VIDEO_X) = 0.23
Same video. Completely different scores for different users.
What is stored: video content embedding (once at upload), engagement counters (real-time), velocity signals (rolling windows), user preference embedding (updated every interaction).
What is NOT stored: the feed ranking score itself, computed fresh every time you open the app. Pull down to refresh = trigger real-time inference on 1000+ candidates, scored against YOUR interest embedding, ranked, diversity rules applied, top 50 served. All under 200ms.
Ultimately, the final ranking comes down to an equation similar as below:
Total Score = (w₁ · Share) + (w₂ · Watch Time) + (w₃ · Save) - (w₄ · Skip)
The weights (w) assigned to each action change constantly via machine learning automation. Because these weights adjust based on changing user behavior patterns, even Instagram’s own engineers cannot pinpoint the exact formula at any single moment.
How Videos Go Viral: The Expansion Loop
Virality is not a single event. It’s a chain reaction where content passes through increasingly larger audience boundaries, and each boundary demands its own proof of engagement before hitting the next gate:
Boundary 1: Seed followers (5-10%)
Boundary 2: Remaining followers + their connections
Boundary 3: Topic-interest clusters (non-followers)
Boundary 4: Explore page (broad discovery)
Boundary 5: Global Reels feed
Boundary 6: Cross-platform (WhatsApp, Twitter, Reddit)
At each boundary, engagement rate MUST hold. The moment new audiences stop engaging, the algorithm pulls back. Most videos die at boundary 2-3.
The single strongest signal for crossing boundaries: Shares. Not likes, not comments. A share literally puts your video in front of someone who never heard of you.
Non-viral: 100 see → 5 engage → stops (expansion rate < 1)
Viral: 100 see → 30 engage → 500 see → 125 engage → 2500 see → ...
(expansion rate > 1 at every boundary = exponential)
The Collective Consciousness
Think of a massive traffic jam in a city. No single driver decides to slow down. But when one car brakes, the car behind brakes, and the one behind that, and suddenly thousands of vehicles are moving as a single synchronized unit without any coordination. No one planned it. No one leads it. Yet every car acts in unison. This is emergent collective behavior, individual agents responding to local signals, producing global patterns.
Instagram’s algorithm isn’t emergent like traffic, it’s engineered. A central system deliberately synchronizes the attention of billions. When it amplifies content, millions of feeds update simultaneously, and users didn’t choose to look at the same thing, the algorithm chose for them.
The architecture behind this uses specific named systems. The Two Towers Neural Network powers real-time recommendations: one tower encodes the user (interaction history, preferences, demographics), the other tower encodes the content (visual embedding, audio, engagement signals). The dot product between the two towers produces a relevance score in milliseconds. For candidate retrieval at scale, Instagram built IGQL (Instagram Graph Query Language), a domain-specific language optimized in C++ for filtering millions of candidate posts down to thousands before the ranking models even run. The final ranking uses deep learning scoring models that predict P(like), P(comment), P(share), P(save), and P(watch_complete) simultaneously, then combine them with learned weights.
The Layers Behind Organic Growth: Don’t Be Evil
Is “organic reach” a myth? Is there truly such a thing as purely organic distribution on Instagram? What creators perceive as organic may actually be the output of a multi-layered system that has already filtered, scored, boosted, or suppressed their content before a single follower sees it. The ML model is just the first gate. Here’s what runs beneath it:

Every piece of content passes through five layers before it hits your feed:
Layer 1: ML model (organic ranking)
Layer 2: Policy multipliers (boost Reels, suppress topics)
Layer 3: Manual overrides (specific content/creators)
Layer 4: Integrity filters (borderline content demotion)
Layer 5: Business priorities (promote new features)
Only Layer 1, the ML ranking model, operates on what we might call organic signals. Layers 2 through 5 override it silently based on business strategy, regulatory compliance, content policy, and competitive priorities. The user never sees which layer made the final decision. The feed appears seamless, as if one algorithm produced it, but in reality multiple systems voted on every piece of content before it reached your screen.
def apply_policy_layer(video, score):
if video.type == 'reel':
score *= 1.3 # Business priority: competing with TikTok
if video.topic_cluster in SUPPRESSED_TOPICS:
score *= 0.2 # Content policy
if video.integrity_score < BORDERLINE_THRESHOLD:
score *= 0.1 # Effectively hidden without "removing"
if video.creator_id in BOOSTED_CREATORS:
score *= 2.0 # Partner program
return score
Fragile or Forged
A common question people ask: can a viral video just disappear due to a system glitch? The short answer is no. Instagram’s storage layer is write-once, append-only, replicated across five global data centers with self-healing mechanisms at every tier. A single server failure triggers automatic failover to replicas in milliseconds. A deployment bug gets caught by canary rollouts before it touches the full fleet. The media file itself is the most protected asset in the entire stack. Content can only be removed through deliberate action: user deletion, moderation takedown, legal compliance, or account suspension. There have been rare instances where videos temporarily disappeared from feeds due to ranking bugs, but the actual file was never lost, just momentarily unreachable through the recommendation layer. The system is not fragile. It has been hammered by billions of requests daily for over a decade, and it was architected to survive precisely that kind of relentless pressure.
Conclusion
Instagram has built one of the most sophisticated content delivery systems in human history. It serves 2.5 billion people personalized experiences in real-time, and that’s genuinely remarkable engineering. But understanding how it works also means acknowledging what it is. Instagram’s recommendation system is not a neutral mirror of user preferences. It is a policy enforcement tool that happens to look like a recommendation engine. The algorithm simultaneously optimizes for user engagement, business goals, content policy, regulatory compliance, and competitive strategy, all through the same sophisticated scoring function. What you see in your feed was not chosen by you, it was chosen for you, by a system that understands your engagement patterns at a level that’s difficult to fully comprehend. The platform processes 95 million pieces of content a day, each scored in under 200 milliseconds. The midnight selfie video entered an algorithmic system that decided, in under a second, that 2.5 billion people needed to see it. And they did. Not because they chose to, but because the machine chose for them. The algorithm is not the product. The algorithm is the power. And power is never neutral. “The one who controls the feed, controls the collective consciousness.”

References:
-
TechCrunch - “Instagram launches chronological and ‘favorites’ feeds for all users, but they can’t be the default” (March 23, 2022) https://techcrunch.com/2022/03/23/instagram-launches-chronological-and-favorites-feeds-for-all-users-but-they-cant-be-the-default/
-
Meta Transparency Center - “Instagram Feed Recommendations” (2026) https://transparency.meta.com/features/explaining-ranking/ig-feed-recommendations/
-
USENIX OSDI - “f4: Facebook’s Warm BLOB Storage System” (2014) https://www.usenix.org/conference/osdi14/technical-sessions/presentation/muralidhar
-
Meta Engineering - “Meta’s AI Storage Blueprint at Scale” (July 2026) https://engineering.fb.com/2026/07/01/data-infrastructure/metas-ai-storage-blueprint-at-scale/
-
NIH/PMC - “Social Media Algorithms and Teen Addiction: Neurophysiological Impact and Ethical Considerations” (2025) https://pmc.ncbi.nlm.nih.gov/articles/PMC11804976/
-
Stanford Behavior Design Lab - “Fogg Behavior Model” https://behaviordesign.stanford.edu/resources/fogg-behavior-model
-
Nir Eyal - “Hooked: How to Build Habit-Forming Products” (2014)
-
TechAheadCorp - “Decoding Instagram System Design & Architecture (And How Reels Recommendation Works)” (2026) https://www.techaheadcorp.com/blog/decoding-instagram-system-design-architecture-and-how-reels-recommendation-works/
-
Quastor - “The Engineering behind Instagram’s Recommendation Algorithm” (2025) https://quastor.beehiiv.com/p/engineering-behind-instagrams-recommendation-algorithm-dc9c
-
dev.to - “Rebuilding Instagram in 2026” https://dev.to/codingjoe_dev/rebuilding-instagram-in-2026-3m00
© 2026 Abhishek Dey (ORCID: 0009-0006-5427-7058). Content licensed under CC-BY-NC-4.0.