TrenTorch Launches 1639 Hands-On Machine Learning Problems

Original title: TrenTorch: Learn machine learning by building it
58AI Score

TrenTorch is a hands-on machine learning learning platform built around writing code rather than reading about it, offering 1,639 practice problems across 74 topics with clear explanations, such as implementing KV cache memory accounting from scratch. It is free forever with no subscriptions, funded by sponsors and donations, with infrastructure from Vercel and Mintlify.

Related Entities

Full Report

Contents14 sections

Learn machine learning by building it.

Don't just read about AI. Write it yourself, one small step at a time, and see exactly what your code does. 1639+ practice problems, each with a clear explanation.

Free forever. No subscriptions. Supported by sponsors and donations.

Problemset Browse topics

1639

Problems

74

Topics

kv_cache_accountant.py Medium from typing import Tupledef kv_cache_accountant(b: int, l: int, h: int, d: int, bytes_per_scalar: int, g: int) -> Tuple[int, int]: """ b: batch size. l: number of layers. h: attention heads. d: head dimension. bytes_per_scalar: bytes per scalar (1, 2, or 4). g: memory budget in bytes. per_token = 2 * b * l * h * d * bytes_per_scalar (keys and values). t_max = g // per_token (floor division, exact integers throughout). # ... from typing import Tuple def kv_cache_accountant(b: int, l: int, h: int, d: int, bytes_per_scalar: int, g: int) -> Tuple[int, int]: """ b: batch size. l: number of layers. h: attention heads. d: head dimension. bytes_per_scalar: bytes per scalar (1, 2, or 4). g: memory budget in bytes. per_token = 2 * b * l * h * d * bytes_per_scalar (keys and values). t_max = g // per_token (floor division, exact integers throughout). # ... LLM Inference · Kv Cache Continue in IDE [Data structures & algorithms

454 problems

Open the sheet](https://trentorch.com/modules/software) [Research papers

Latest

Mamba: Linear-Time Sequence Modeling with Selective State Spaces](https://trentorch.com/papers) Today's Problem: THE KV-CACHE ACCOUNTANT Medium

0+

Learners and growing

Learners signing up from top companies and campuses

xAI SpaceX Waterloo IIT Bombay BITS Pilani IISc NITs IIITs xAI SpaceX Waterloo IIT Bombay BITS Pilani IISc NITs IIITs

Based on signup email domains. Not an endorsement, see footer.

What people are saying

[Testimonial screenshot

](https://x.com/athrix_codes/status/2099409710579642664?s=20)[![Testimonial screenshot](/api/v1/file/hot_img_9619a3703a0f5db9ba3da3e93ff90e45.webp)

](https://x.com/ascorbichelix/status/2099468952573460564?s=20)[![Testimonial screenshot](https://trentorch.com/testimonial-screenshots/harsh.png)

](https://x.com/harshbhatt7585/status/2099897450945446316?s=20)[![Testimonial screenshot](/api/v1/file/hot_img_173c675ecda02cbf44b2f68187c209f1.webp)

](https://x.com/syuggupta/status/2099199455081926796?s=20)[![Testimonial screenshot](/api/v1/file/hot_img_50de315210f437b17d1d2466ea22f17f.webp)

](https://x.com/avrldotdev/status/2099199587550711993?s=20)[![Testimonial screenshot](/api/v1/file/hot_img_709b041d03fddd1d5a8e155de278c352.webp)

](https://x.com/Divyansh91565/status/2099221515028042231?s=20)[![Testimonial screenshot](https://trentorch.com/testimonial-screenshots/tanu.png)

](https://x.com/serotoninwave/status/2099366590798262537?s=20)[![Testimonial screenshot](https://trentorch.com/testimonial-screenshots/harshit.png)

](https://x.com/Harry_The_Nerd/status/2099426912422736170?s=20)[![Testimonial screenshot](https://trentorch.com/testimonial-screenshots/aditya.png)

](https://x.com/AdityaPat_/status/2099571984078368861?s=20)[![Testimonial screenshot](https://trentorch.com/testimonial-screenshots/simran.png)

](https://x.com/simm_designs/status/2099362178814140800?s=20)[![Testimonial screenshot](https://trentorch.com/testimonial-screenshots/vaibhav.png)

](https://x.com/Vaibhav_14ry/status/2099358103343165813?s=20)[![Testimonial screenshot](/api/v1/file/hot_img_ad71c8339788c9330ace859a548fecd5.webp)

](https://x.com/tech_Shreya_200/status/2099201391038545981?s=20)[![Testimonial screenshot](https://trentorch.com/testimonial-screenshots/anushka.png)

](https://x.com/AnushkaDesign/status/2100885885604831604?s=20)[![Testimonial screenshot](https://trentorch.com/testimonial-screenshots/mitali.png)

](https://x.com/kayleecodez/status/2099207156272927108?s=20)[![Testimonial screenshot](https://trentorch.com/testimonial-screenshots/harsh-jain.png)

](https://lnkd.in/p/dUNc5pqD)

Explore the curriculum

From real-world ML problems to rigorous DSA fundamentals.

TrenTorch combines hands-on machine learning challenges with a carefully structured data structures and algorithms sheet. Learn the reasoning, implement the solution, and understand why it works.

01Applied machine learning

Company case studies

Go beyond textbook exercises. Work through company-inspired scenarios in recommendation systems, experimentation, feature engineering, classification and decision trees. Each challenge turns a practical engineering need into a focused implementation problem.

01stable-softmax-logitsNetflix 02distance-normalized-featuresUber 03entropy-of-clicksGoogle Browse all company case studies cases / netflix / stable-softmax-logitsMedium

Stable softmax for ranking scores

Netflix case · Medium · NumPy

Convert a model's raw ranking scores into probabilities, even when logits are large enough to make a naive exponential overflow.

PYTHON
def softmax(logits):
    shifted = logits - logits.max(axis=-1, keepdims=True)
    exp = np.exp(shifted)
    return exp / exp.sum(axis=-1, keepdims=True)

HIDDEN TESTS**✓ 4 / 4 passed** ✓ Large logits: no overflow ✓ Each row sums to one 02CUDA & GPU programming

Learn the GPU by writing the kernel.

39 theory chapters with interactive figures, 53 kernel problems that run right here, and the most advanced topics, up to multi-GPU. Over 60 interactive figures, from warps and bank conflicts to ring AllReduce and multi-GPU scaling. Every card is a live link: open a figure, change a number, then write the kernel.

01

Interactive theoryWatch a launch travel from the host to the GPCs, SMs, warps and threads.

02

Real kernels, real feedbackBytes moved, coalescing, bank conflicts and divergence for every run.

03

Multi-GPU problemsAllReduce, halo exchange, data-parallel training and deadlock hunts.

Explore the CUDA course cudaSee it. Then write it. Jump in anywhereLive links · TrenTorch CUDA 01 · Interactive theory3 links ○ Follow a launch from host to thread figure○ Memory coalescing, live figure○ Bank conflicts grid figure02 · Multi-GPU, visualised3 links ○ Ring AllReduce, step by step figure○ Topology, halo exchange, scaling curve figure○ Multi-GPU and bug-hunt problems problems03 · Write the kernel2 links ○ All problems, with a theory link on each problems○ The calculation workbook workbook 03Research papers · Read, annotate, implement

Read the paper. Mark it up.

Open the original paper in your browser. Highlight the lines that matter, draw on the page, and keep notes beside the text. Then implement the paper's ideas yourself, step by step.

Explore papers across every major topic

01Neural Network FoundationsRead & code 02Optimization & TrainingRead & code 03Transformers & LLMsRead & code 04Classical ML & Learning TheoryRead & code 05Reinforcement Learning & AlignmentRead & code 06Unsupervised & Representation LearningRead & code 07Computer VisionRead & code 08Agentic SystemsRead & code 09Inference, Distributed & ProductionRead & code 10Sequence Models & AttentionRead & code Explore all research papers papers / attention-is-all-you-need1 / 15 ReadDrawHighlightTextErase Saved in this browser

Attention Is All You Need

3.2.1 Scaled Dot-Product Attention

Attention(Q, K, V) = softmax( QKᵀ / √dₖ) V

← key idea

transformers-llms / scaled-dot-product-attentionIntermediate

Attention Is All You Need: Scaled Dot-Product Attention

The problem, from first principles

Attention Is All You Need (Vaswani et al., 2017) drops recurrence entirely. Each position builds its output by comparing a query with every key, turning similarities into weights, and averaging the values with those weights. Dividing by the square root of the key dimension keeps the softmax from saturating.

From theory to code

Implement scaled_dot_product_attention(Q, K, V), which returns softmax(QK^T / sqrt(d)) V with a row-wise softmax.

Constraints

  • Q and K share the feature dimension d.
PYTHON
def scaled_dot_product_attention(Q, K, V):
    # softmax(QK^T / sqrt(d)) V, row-wise softmax
    ...

hidden testsRun · 0 / 5 04Research papers · Code

Then code the paper.

Every paper comes with questions that start from first principles and end in working code. Implement the idea yourself and run it against hidden tests.

01

The problem, from first principlesWhat the paper is actually solving, in plain terms

02

From theory to codeThe exact function to write, with real shapes and defaults

03

Constraints that matterThe edge cases the paper assumes, spelled out

04

Check it against hidden testsPass everything and the paper is yours

Code the paper 05Algorithms & problem solving

A DSA sheet built around understanding.

Prepare with a structured, Google-level data structures and algorithms curriculum. Learn the theory, recognize patterns, and practise with real questions from the TrenTorch DSA sheet—then track your progress as you improve.

01

Understand the theoryBuild intuition before jumping into implementation.

02

Recognize reusable patternsConnect ideas across algorithms and data structures.

03

Practise with purposeWork through curated questions and difficulty levels.

Explore the complete DSA sheet dsa-sheetLearn the idea. Then solve. Questions from your sheetLive links · TrenTorch DSA 01 · Number Theory2 selected ○ Count Primes Intermediate○ Prime Factorization Intermediate02 · Dynamic Programming2 selected ○ Climbing Stairs Beginner○ Min Cost Climbing Stairs Beginner03 · Range Queries2 selected ○ Fenwick Tree (Prefix Sums With Updates) Advanced○ Segment Tree (Range Minimum With Updates) Advanced04 · Design and Data Structures2 selected ○ LRU Cache Intermediate○ LFU Cache Mastery Arrays Trees Graphs DP

Beyond writing code

The goal isn't just to teach you how to write the code

It's to help you understand what your code is actually doing underneath

Hosting & OSS support by

Vercel Mintlify

Thanks to Vercel and Mintlify for providing infrastructure

Free. Money shouldn't be the barrier to learning ML.

We don't charge users and we don't sell your data. TrenTorch runs entirely on sponsorships and donations.