Practice
0/754 solved · 420 free, 334 ProProblemDifficulty
Compute every pairwise distance without a Python loopNumPy foundationsEasyOne-hot encode class labels with fancy indexingNumPy foundationsEasyRank leaderboard scores so ties share a placeNumPy foundationsEasyUndo a length sort with the inverse permutation from argsortNumPy foundationsEasyRemap sparse token ids to a compact vocabulary with np.uniqueNumPy foundationsEasyAverage values per group id with weighted bincountNumPy foundationsEasyDivide arrays safely with a fill value where the denominator is zeroNumPy foundationsEasyAdd per-query and per-document biases to a score matrix with broadcastingNumPy foundationsEasyTurn each row of counts into a probability distributionNumPy foundationsEasyPick the log-probability of the correct token at every positionNumPy foundationsEasyAverage only the real tokens in a padded batchNumPy foundationsMediumCut a token sequence into overlapping fixed-size windowsNumPy foundationsMediumAnswer many range-sum queries in constant time with prefix sumsNumPy foundationsMediumAssign sequences to length buckets with searchsorted and count paddingNumPy foundationsMediumCompute all pairwise Jaccard similarities from a binary matrixNumPy foundationsMediumBuild a causal mask that also blocks attention across packed documentsNumPy foundationsMediumSort a leaderboard by score, then latency, then name with np.lexsortNumPy foundationsMediumPad variable-length token lists into a batch with a maskNumPy foundationsMediumCompute a masked logsumexp that never overflowsNumPy foundationsMediumApply a numerically stable softmax inside each group of a flat arrayNumPy foundationsProHardExtract strided, dilated windows with as_strided and no copiesNumPy foundationsProHardSelect the top-k items inside every group without a Python loopNumPy foundationsProHardReturn the top k values per row, sorted, with stable tie breakingNumPy foundationsProHardBuild a cosine similarity matrix for a set of embeddingsLinear algebraEasyMeasure how much a rank-k approximation loses with the SVDLinear algebraEasyProject vectors onto the span of a few basis vectorsLinear algebraEasyCount the numerical rank of a matrix from its singular valuesLinear algebraEasyCompute a matrix's 2-norm condition number from its singular valuesLinear algebraEasyFind the main direction of your data with PCALinear algebraMediumOrthonormalise a set of vectors with Gram-SchmidtLinear algebraMediumSolve least squares with an SVD pseudo-inverse that drops tiny singular valuesLinear algebraMediumSolve a tridiagonal system in linear time with the Thomas algorithmLinear algebraMediumWrite a Cholesky factorisation and use it to solve a systemLinear algebraMediumFind the eigenvalue nearest a shift with inverse power iterationLinear algebraMediumFind the top k eigenpairs with power iteration and deflationLinear algebraProHardCompute a QR decomposition with Householder reflectionsLinear algebraProHardFactor a matrix as PA = LU with partial pivoting and get its determinantLinear algebraProHardCheck a gradient with central differencesCalculus and gradientsEasyDifferentiate a quadratic form when the matrix is not symmetricCalculus and gradientsEasyDerive the gradient of mean squared error for a linear modelCalculus and gradientsEasyBuild a Jacobian with central finite differencesCalculus and gradientsEasyClassify a critical point from its HessianCalculus and gradientsEasyDerive the gradient of softmax plus cross-entropyCalculus and gradientsMediumDerive the gradient of cosine similarity with respect to one vectorCalculus and gradientsMediumCompute the Hessian of the logistic regression lossCalculus and gradientsMediumChoose a step size with Armijo backtracking line searchCalculus and gradientsMediumDifferentiate the Gaussian negative log-likelihood with respect to mean and log sigmaCalculus and gradientsMediumPush a gradient through tanh by the chain ruleCalculus and gradientsProHardTake a Hessian-free Newton step with finite-difference Hessian-vector productsCalculus and gradientsProHardDifferentiate a validation loss through a ridge regression solutionCalculus and gradientsProHardCheck lasso optimality with the KKT subgradient conditionsCalculus and gradientsProHardTrack mean and variance of a stream in one passProbability and statisticsEasyCompute the KL divergence between two diagonal GaussiansProbability and statisticsEasyCompare two token distributions with Jensen-Shannon divergenceProbability and statisticsEasySample categories from fixed uniforms with the inverse CDFProbability and statisticsEasyCompute the mean and variance of a discrete random variable and of aX + bProbability and statisticsEasyUpdate a discrete posterior over hypotheses after each observationProbability and statisticsEasyPut a Wilson score confidence interval on a success rateProbability and statisticsEasyCompare two classifiers on the same test set with McNemar's testProbability and statisticsEasyDecide if a new prompt really converts better with a two-proportion z-testProbability and statisticsMediumUpdate your belief about a model's pass rate with a Beta priorProbability and statisticsMediumPut a bootstrap confidence interval on an evaluation scoreProbability and statisticsMediumCompare two eval runs with Welch's t-test statisticProbability and statisticsMediumCompute Spearman rank correlation with averaged tie ranksProbability and statisticsMediumRun a two-sample permutation test for a difference in meansProbability and statisticsMediumCompute the chi-square test of independence for a contingency tableProbability and statisticsMediumBuild split conformal prediction intervals for a regressorProbability and statisticsMediumCompute the sample size per group for a two-proportion A/B testProbability and statisticsMediumEvaluate a multivariate Gaussian log-density stably with a Cholesky factorProbability and statisticsProHardControl false discoveries across many eval comparisonsProbability and statisticsProHardBuild conformal prediction sets for a classifier with adaptive scoresProbability and statisticsProHardStandardise features without leaking test dataData processing and featuresEasyScale features with the median and IQR so outliers do not dominateData processing and featuresEasyEncode hour of day and day of week as sine and cosine featuresData processing and featuresEasyClip outliers using percentiles learned on the training set onlyData processing and featuresEasyTurn categorical tokens into a fixed-size vector with the hashing trickData processing and featuresEasyCompute balanced class weights for an imbalanced datasetData processing and featuresEasyFit a min-max scaler on train and apply it to testData processing and featuresEasyOrdinal-encode a category column and map unseen values to -1Data processing and featuresEasyImpute missing values with train medians and add missing-indicator columnsData processing and featuresEasyCap outliers with IQR fences learned from training dataData processing and featuresEasyBin a feature into equal-width buckets learned on trainData processing and featuresEasyFind test rows that also appear in the training setData processing and featuresEasyBuild stratified K-fold validation folds by dealing each class round-robinData processing and featuresEasyExpand features into degree-2 polynomial and interaction termsData processing and featuresEasySplit a dataset so every class keeps its shareData processing and featuresMediumBin a feature into quantile buckets learned from training dataData processing and featuresMediumFrequency-encode a category with a shared bucket for rare and unseen valuesData processing and featuresMediumGenerate K-fold train and validation index splitsData processing and featuresMediumRemove duplicate training texts after normalising themData processing and featuresMediumOne-hot encode with an 'other' column for rare and unseen categoriesData processing and featuresMediumFlag outliers with the modified z-score based on the medianData processing and featuresMediumApply the Yeo-Johnson power transform for a given lambdaData processing and featuresMediumExtract hour, weekday and cyclic time features from Unix timestampsData processing and featuresMediumTarget-encode a category with smoothingData processing and featuresProHardFit imputation, scaling and one-hot encoding on train and apply them to testData processing and featuresProHardEstimate Jaccard similarity between documents with MinHash signaturesData processing and featuresProHardSplit folds by user so no user lands in both train and validationData processing and featuresProHardFill missing values from the k nearest rows (KNN imputation)Data processing and featuresProHardChoose the Box-Cox lambda by maximum likelihood over a gridData processing and featuresProHardFit linear regression in one line with the normal equationRegressionEasyFit a polynomial curve by expanding x into powersRegressionEasyCompute the elastic net penalty and its gradientRegressionEasyTrain logistic regression one gradient step at a timeRegressionMediumStop overfitting with ridge regressionRegressionMediumTrain a regression that shrugs off outliers with the Huber lossRegressionMediumFit weighted least squares in closed formRegressionMediumTake one gradient step for softmax regressionRegressionMediumCompute the quantile (pinball) lossRegressionMediumFit ridge regression with cyclic coordinate descentRegressionMediumFit Lasso with coordinate descent and soft thresholdingRegressionProHardFit Poisson regression with Newton stepsRegressionProHardCompute the Bayesian linear regression posteriorRegressionProHardFit elastic net with an intercept by coordinate descentRegressionProHardTrain L2-regularised logistic regression with Newton's methodRegressionProHardCompute OLS coefficients, standard errors and t-statisticsRegressionProHardFit isotonic regression with the pool adjacent violators algorithmRegressionProHardScore ridge penalties with the leave-one-out shortcutRegressionProHardClassify points by majority vote of their nearest neighboursSupervised modelsEasyRun one epoch of the perceptron learning ruleSupervised modelsEasyClassify by the nearest class centroidSupervised modelsEasyCompute information gain for one splitSupervised modelsEasyClassify with distance-weighted k nearest neighbour votesSupervised modelsEasyFind the best decision tree split with Gini impuritySupervised modelsMediumTrain a linear SVM with hinge loss subgradient descentSupervised modelsMediumPredict with distance-weighted k nearest neighboursSupervised modelsMediumRun one round of gradient boosting for squared errorSupervised modelsMediumClassify word-count vectors with multinomial Naive BayesSupervised modelsMediumClassify binary feature vectors with Bernoulli Naive BayesSupervised modelsMediumCompute information gain and gain ratio for a categorical splitSupervised modelsMediumScore a random forest with out-of-bag votesSupervised modelsMediumFind the best split with the XGBoost gain formulaSupervised modelsMediumFind Fisher's linear discriminant direction for two classesSupervised modelsMediumPredict with Gaussian Naive BayesSupervised modelsProHardBoost decision stumps with AdaBoost and reweightingSupervised modelsProHardGrow a depth-limited regression treeSupervised modelsProHardRun one iteration of k-meansUnsupervised learningEasyPick spread-out starting centroids with farthest-first seedingUnsupervised learningEasyReport the explained variance ratio of PCAUnsupervised learningEasyCompute soft cluster memberships for a Gaussian mixtureUnsupervised learningProMediumMerge points bottom-up with single linkage clusteringUnsupervised learningProMediumPick k-means++ starting centers deterministicallyUnsupervised learningProMediumMove points one mean-shift stepUnsupervised learningProMediumRun k-means to convergence and re-seed empty clustersUnsupervised learningProMediumProject data onto k principal components with the SVD and reconstruct itUnsupervised learningProMediumScore a clustering with the Davies-Bouldin indexUnsupervised learningProMediumScore a clustering with the silhouette coefficientUnsupervised learningProHardFind dense clusters and noise points with DBSCANUnsupervised learningProHardRun EM for a 1D Gaussian mixtureUnsupervised learningProHardCompute t-SNE input affinities with a perplexity searchUnsupervised learningProHardBuild an agglomerative clustering tree with complete or average linkageUnsupervised learningProHardCompute precision, recall and F1 from predictionsEvaluation metricsEasyMeasure how overconfident a classifier is with expected calibration errorEvaluation metricsEasyBuild a confusion matrixEvaluation metricsEasyCompute mean reciprocal rankEvaluation metricsEasyPick a final answer by self-consistency majority voteEvaluation metricsEasyConvert language model loss to bits per byteEvaluation metricsEasyCompute R-squared and adjusted R-squared for a regressionEvaluation metricsEasyCompute the Matthews correlation coefficient for a binary classifierEvaluation metricsEasyCompute ROC AUC by counting ranked pairsEvaluation metricsMediumGrade a search ranking with NDCG at kEvaluation metricsMediumCompute macro and micro F1 for a multi-class classifierEvaluation metricsMediumMeasure rater agreement with Cohen's kappaEvaluation metricsMediumEstimate pass@k without biasEvaluation metricsMediumCompute ROUGE-L F1 from the longest common subsequenceEvaluation metricsMediumExtract and normalise a final answer for a math verifierEvaluation metricsMediumScore pairwise LLM-judge results with position swappingEvaluation metricsMediumCompute exact match and token F1 for QA answersEvaluation metricsMediumCompute the points of a ROC curve with tied scoresEvaluation metricsMediumPick the decision threshold that maximises F1Evaluation metricsMediumBuild a precision recall curve and average precision with tied scoresEvaluation metricsProHardCompute sentence BLEU with brevity penaltyEvaluation metricsProHardScore multiple-choice answers by log-likelihoodEvaluation metricsProHardEvaluate perplexity of a long text with a strided sliding windowEvaluation metricsProHardBatch LM cross-entropy with ignore index, perplexity and gradientEvaluation metricsProHardCalibrate classifier scores with Platt scalingEvaluation metricsProHardCompare two clusterings with the adjusted Rand indexEvaluation metricsProHardSmooth a noisy metric with an exponential moving averageTime seriesEasyGenerate walk-forward train and test windows for backtestingTime seriesEasyCompute a trailing rolling meanTime seriesEasyCompute symmetric MAPETime seriesEasyForecast with the seasonal naive methodTime seriesEasyBuild lag and difference features for forecastingTime seriesMediumFind the weekly pattern with autocorrelationTime seriesMediumForecast a trending series with Holt's linear smoothingTime seriesMediumCompute mean absolute scaled errorTime seriesMediumSplit a series into trend, seasonal and residualTime seriesMediumDetect a mean shift with CUSUMTime seriesMediumPick the smoothing factor of simple exponential smoothing by one-step errorTime seriesMediumTest residuals for leftover autocorrelation with the Ljung-Box statisticTime seriesMediumFit an AR(p) model by least squares and forecast several steps aheadTime seriesProHardFilter a noisy signal with a 1D Kalman filterTime seriesProHardCompute the partial autocorrelation function with Durbin-LevinsonTime seriesProHardMeasure hit rate and recall at k for a recommenderRecommender systemsEasyCompute the BPR ranking loss for implicit feedback without overflowRecommender systemsEasyRecommend the most popular unseen itemsRecommender systemsEasyMeasure catalog coverage of recommendationsRecommender systemsEasyRank trending items with time-decayed popularityRecommender systemsEasyBlend personal and popular scores for cold-start usersRecommender systemsEasyMeasure intra-list diversity of a recommendation listRecommender systemsEasyRecommend the next item from session transition countsRecommender systemsEasyPredict a rating from similar usersRecommender systemsProMediumTake one SGD step of matrix factorisationRecommender systemsProMediumRecommend unseen items with item-item cosine similarityRecommender systemsProMediumSample negative items a user has not interacted withRecommender systemsProMediumCompute mean average precision at kRecommender systemsProMediumRecommend related items by co-occurrence liftRecommender systemsProMediumTake one SGD step of Bayesian personalized rankingRecommender systemsProMediumPredict with a factorization machine in linear timeRecommender systemsProMediumRe-rank a feed with per-creator caps and a no-repeat windowRecommender systemsProMediumRun one full alternating least squares sweep on observed ratingsRecommender systemsProHardCorrect in-batch softmax for item popularityRecommender systemsProHardSolve user factors in implicit-feedback ALS with confidence weightsRecommender systemsProHardCompare two rankers online with team-draft interleavingRecommender systemsProHardImplement GELU, the activation inside GPT and BERTActivationsEasyCompute softplus without overflowing on large inputsActivationsEasyImplement ELU and its derivativeActivationsEasyImplement hard swishActivationsEasyFind the fraction of dead ReLU unitsActivationsEasyImplement PReLU with a learnable slope per channelActivationsEasyCompute maxout units and which piece wonActivationsEasyWrite a sigmoid and log-sigmoid that never overflowActivationsMediumReturn SiLU and its exact derivative for the backward passActivationsMediumImplement mish and its gradientActivationsMediumBuild the SwiGLU feed-forward block used in LlamaActivationsProHardForward and backward pass for GLU, ReGLU, SwiGLU and GEGLU gatesActivationsProHardImplement sparsemaxActivationsProHardBinary cross-entropy straight from logitsLossesEasyCross-entropy with label smoothing from raw logitsLossesEasyCompute the multiclass hinge lossLossesEasyCompute the soft Dice lossLossesEasyCompute smooth L1 box regression loss over positive anchorsLossesEasyDown-weight easy examples with focal lossLossesMediumToken-level distillation KL that ignores paddingLossesMediumCompute batch-hard triplet lossLossesMediumCompute class-weighted cross-entropyLossesMediumTrain embeddings with the InfoNCE contrastive lossLossesProHardSymmetric contrastive loss and its gradient with respect to the similarity matrixLossesProHardCompute the supervised contrastive lossLossesProHardAdd momentum to gradient descentOptimizersEasyClip a list of gradients by their combined global normOptimizersEasyTake a Nesterov momentum stepOptimizersEasyCompute the Noam warmup learning rateOptimizersEasyCompute an exponentially weighted average with bias correctionOptimizersEasyRun Adagrad on a quadratic with uneven curvatureOptimizersEasySimulate reduce-learning-rate-on-plateauOptimizersEasyImplement one step of the Adam optimizerOptimizersMediumRun the sign-based Lion optimizer with decoupled weight decayOptimizersMediumTake a centered RMSProp stepOptimizersMediumWrap an optimizer with LookaheadOptimizersMediumRun Adadelta, the optimizer with no learning rateOptimizersMediumBuild a warmup plus cosine schedule with warm restartsOptimizersMediumClip gradients unit-wise relative to weight norms (AGC)OptimizersMediumAdamW with linear warmup and cosine decayOptimizersProHardMinimise a quadratic with AdamW, bias correction and a no-decay maskOptimizersProHardCompute Adafactor's factored second momentOptimizersProHardBackward pass of a dense layerNeural networksEasyCompute Xavier and He initialisation scales for dense and conv weightsNeural networksEasyCount the parameters of an MLPNeural networksEasyFind where early stopping haltsNeural networksEasyRun an MLP forward pass and keep every layer's activationNeural networksEasyAdd L1 and L2 penalties and their gradients to weight matrices onlyNeural networksEasyMeasure the vanishing gradient through a chain of sigmoid layersNeural networksEasyApply drop path (stochastic depth) to a residual branchNeural networksEasyImplement inverted dropoutNeural networksMediumForward pass of a pre-norm residual MLP blockNeural networksMediumBackpropagate through an embedding lookupNeural networksMediumBackpropagate through a 2-layer tanh net for regression and binary classificationNeural networksMediumTrace activation spread through deep ReLU layers for Xavier and He initNeural networksMediumRun one training epoch with full-batch, mini-batch or SGD updatesNeural networksMediumEstimate prediction uncertainty with Monte Carlo dropoutNeural networksMediumTrain a tiny MLP to learn XORNeural networksProHardBackprop a 2-layer ReLU MLP with softmax cross-entropy, ignored labels and weight decayNeural networksProHardBackpropagate through a residual MLP blockNeural networksProHardOrder a compute graph for backprop with a topological sortAutogradEasyRun reverse mode over an op tape where values are reusedAutogradEasyWrite the backward pass of a matrix multiplyAutogradEasyRun forward-mode autodiff over a tiny instruction listAutogradEasyBuild a tiny reverse-mode autograd engineAutogradMediumReduce a broadcast gradient back to the input's shapeAutogradMediumRoute gradients through a max reductionAutogradMediumCompute a gradient on a DAG with memoized backpropAutogradMediumBackprop through softmax without building the JacobianAutogradProHardBuild a Value autograd class that survives very deep graphsAutogradProHardBackprop a deep tanh chain with gradient checkpointingAutogradProHardNormalize activations with RMSNormNormalizationEasyImplement LayerNorm forwardNormalizationEasyStandardise conv weights per output channelNormalizationEasyApply batch norm to conv feature maps per channelNormalizationEasyApply instance normalization to imagesNormalizationEasyBatchNorm with running statistics for inferenceNormalizationMediumImplement GroupNorm with contiguous channel groupsNormalizationMediumFold an eval-mode batch norm into the preceding linear layerNormalizationMediumDerive the LayerNorm backward passNormalizationProHardDerive the BatchNorm training-mode backward pass for 2-D and 4-D inputsNormalizationProHardImplement the backward pass of group normalizationNormalizationProHardWrite a 2D convolution with stride and paddingComputer visionEasyTrack feature map sizes through a stack of dilated convolutionsComputer visionEasyConvert an image batch from NHWC to NCHWComputer visionEasyBuild a normalised 2D Gaussian kernelComputer visionEasyCompare parameters and multiply-adds of standard vs depthwise separable convComputer visionEasyCompute the receptive field of a stack of conv layersComputer visionEasyCenter-crop a U-Net skip connection and concatenateComputer visionEasyHorizontally flip and crop an image together with its boxesComputer visionEasyMax pooling forward and backwardComputer visionProMediumDetect edges with Sobel filters and a magnitude thresholdComputer visionProMediumUnfold image patches with im2colComputer visionProMediumResize an image with bilinear interpolationComputer visionProMediumRun a depthwise separable conv block forwardComputer visionProMediumImplement average pooling forward and backward with overlapping windowsComputer visionProMediumApply a squeeze-and-excitation block to feature mapsComputer visionProMediumGenerate anchor boxes over a feature map gridComputer visionProMediumCompute IoU and generalized IoU for box pairsComputer visionProMediumBlur an image with a separable Gaussian filter and reflect paddingComputer visionProMediumTrace tensor shapes and parameter counts through a LeNet-style CNNComputer visionProMediumImplement pixel shuffle (depth to space) upsamplingComputer visionProMediumEncode ground-truth boxes as regression deltas from anchorsComputer visionProMediumRemove duplicate detections with IoU and non-max suppressionComputer visionProHardAssign anchor boxes to ground-truth objects for detector trainingComputer visionProHardImplement a single-channel transposed convolutionComputer visionProHardImplement a multi-channel grouped conv2d with stride, padding and dilationComputer visionProHardImplement the backward pass of a strided multi-channel conv2dComputer visionProHardBuild an Inception module: four branches concatenated on channelsComputer visionProHardRescore overlapping detections with Gaussian soft-NMSComputer visionProHardImplement RoI max pooling for region featuresComputer visionProHardBuild YOLO-style training targets on a grid with anchorsComputer visionProHardRun a vanilla RNN over a sequenceSequence modelsEasyDecode a CTC output with best-path greedy decodingSequence modelsEasyPick the last real hidden state of each sequenceSequence modelsEasyBuild teacher-forcing decoder inputsSequence modelsEasyBatchify a token stream for truncated backprop through timeSequence modelsEasyImplement one step of an LSTM cellSequence modelsProMediumRun one step of a GRU cell on a batchSequence modelsProMediumDecode the best HMM path with ViterbiSequence modelsProMediumCompute Bahdanau additive attentionSequence modelsProMediumRun a stacked (multi-layer) RNN over a sequenceSequence modelsProMediumCarry RNN state through padding with a maskSequence modelsProMediumCompute a Luong attention step with dot or general scoringSequence modelsProMediumBackpropagate through time in a linear RNNSequence modelsProHardCompute the CTC loss with the forward algorithm in log spaceSequence modelsProHardCompute HMM state posteriors with forward-backwardSequence modelsProHardRun a bidirectional RNN on padded sequences of different lengthsSequence modelsProHardUnroll a seq2seq decoder with scheduled teacher forcingSequence modelsProHardImplement the backward pass of one LSTM cell stepSequence modelsProHardScore words by TF-IDFTokenization and NLPEasyEncode text with a byte fallback so no character is ever unknownTokenization and NLPEasyNormalize text by lowercasing, stripping accents and collapsing spacesTokenization and NLPEasyCount word n-grams and return the k most frequent with stable tiesTokenization and NLPEasyBuild a bag-of-words count matrix over a fixed vocabularyTokenization and NLPEasyTurn WordPiece tokens back into text by merging ## piecesTokenization and NLPEasyPre-tokenize text into words, numbers and symbolsTokenization and NLPEasyExtract character n-grams with boundary markersTokenization and NLPEasyDecode SentencePiece pieces back to textTokenization and NLPEasyBuild next-token training pairs with a sliding window and strideTokenization and NLPEasyMeasure tokenizer compression and fertility on a text sampleTokenization and NLPEasyJoin word tokens back into readable textTokenization and NLPEasyDo one merge step of a BPE tokenizerTokenization and NLPMediumCompute Levenshtein edit distanceTokenization and NLPMediumTokenize words with WordPiece greedy longest matchTokenization and NLPMediumBuild a vocabulary with special tokens, a minimum frequency and UNKTokenization and NLPMediumRank documents for a query with smoothed TF-IDF and cosine similarityTokenization and NLPMediumClean text with stopword removal and a rule-based suffix stemmerTokenization and NLPMediumTruncate a sentence pair to a token budget with the longest-first strategyTokenization and NLPMediumEncode a word with ranked BPE mergesTokenization and NLPMediumMap tokens back to character offsetsTokenization and NLPMediumSplit text so special tokens stay wholeTokenization and NLPMediumMap raw bytes to printable characters for byte-level BPETokenization and NLPMediumTrain a bigram language model and measure perplexityTokenization and NLPProHardFind the most likely segmentation with a unigram model and ViterbiTokenization and NLPProHardEncode a batch with CLS and SEP, truncation, padding side and an attention maskTokenization and NLPProHardRecover the edit operations behind a Levenshtein distance by backtrackingTokenization and NLPProHardFind collocations by ranking bigrams with pointwise mutual informationTokenization and NLPProHardScore bigrams with interpolated Kneser-NeyTokenization and NLPProHardRetrieve the top-k chunks for a query embeddingEmbeddings and RAGEasyMerge several retrievers' rankings with reciprocal rank fusionEmbeddings and RAGEasyTruncate Matryoshka embeddings and renormaliseEmbeddings and RAGEasyMeasure recall at k of an approximate indexEmbeddings and RAGEasyRerank retrieved chunks in two stages with a score thresholdEmbeddings and RAGEasyReorder retrieved chunks so the best sit at the edges of the promptEmbeddings and RAGEasySplit a document into overlapping chunksEmbeddings and RAGMediumCombine keyword and vector scores with min-max normalizationEmbeddings and RAGMediumSearch binary-quantised embeddings by Hamming distanceEmbeddings and RAGMediumChunk text by sentences under a token budgetEmbeddings and RAGMediumChunk a document at semantic breakpoints between sentencesEmbeddings and RAGMediumPack retrieved chunks into a token budget for the promptEmbeddings and RAGMediumRemove near-duplicate chunks with word shingles and Jaccard similarityEmbeddings and RAGMediumRank documents with BM25Embeddings and RAGProHardRe-rank retrieved chunks for diversity with maximal marginal relevanceEmbeddings and RAGProHardSearch an inverted-file (IVF) vector indexEmbeddings and RAGProHardScore vectors with product-quantisation lookup tablesEmbeddings and RAGProHardGenerate sinusoidal position encodingsAttention and transformersEasyMeasure how focused each attention row is with entropyAttention and transformersEasyCount attention FLOPs for a sequenceAttention and transformersEasyAdd token and position embeddings for a GPT input batchAttention and transformersEasyShow that an embedding lookup is a one-hot matrix multiplyAttention and transformersEasyWrite scaled dot-product attention with a causal maskAttention and transformersMediumSplit and merge attention headsAttention and transformersMediumBuild the ALiBi attention bias for every headAttention and transformersMediumApply a key padding mask in batched attentionAttention and transformersMediumBucket relative positions like T5Attention and transformersMediumScale RoPE frequencies with NTK-aware interpolationAttention and transformersMediumApply a causal mask when queries are fewer than keysAttention and transformersMediumSplit a fused QKV checkpoint weight into separate projectionsAttention and transformersMediumImplement the original post-norm transformer blockAttention and transformersMediumAdd QK-norm to multi-head causal attentionAttention and transformersMediumCount the parameters of a GPT-2 style modelAttention and transformersMediumRotate a vector by its position (RoPE)Attention and transformersProHardRun a full pre-norm transformer block forward passAttention and transformersProHardBackpropagate through scaled dot-product attentionAttention and transformersProHardCompute the gradient of a tied input and output embeddingAttention and transformersProHardConvert a GPT block to a Llama-style block (RMSNorm, RoPE, SwiGLU)Attention and transformersProHardTurn logits into probabilities without overflowingSampling and decodingEasyKeep only the k most likely tokens before samplingSampling and decodingEasyFilter the next-token distribution with min-pSampling and decodingEasyGreedy decode until end of sequenceSampling and decodingEasyBan tokens and repeated n-grams before samplingSampling and decodingEasyRank finished beams with a length penaltySampling and decodingEasyReturn the chosen token's log-prob and the top alternativesSampling and decodingEasyKeep the nucleus: top-p filteringSampling and decodingMediumApply repetition, frequency and presence penalties to logitsSampling and decodingMediumFilter logits with locally typical samplingSampling and decodingMediumRun batched greedy decoding with per-row EOS trackingSampling and decodingMediumScore next tokens with contrastive decodingSampling and decodingMediumDecode with beam searchSampling and decodingProHardGenerate a sequence with temperature, top-k, top-p and fixed random drawsSampling and decodingProHardDecode under a finite-state grammarSampling and decodingProHardTrim a chat history to fit the context windowLLM inference and servingEasyWork out how many tokens fit in GPU memory for the KV cacheLLM inference and servingEasyCompute TTFT, TPOT and throughput from request timestampsLLM inference and servingEasyPrice an API request with cached input tokensLLM inference and servingEasySize concurrency with Little's lawLLM inference and servingEasyWrite new keys and values into a preallocated batched KV cacheLLM inference and servingEasyPick the best draft length for speculative decodingLLM inference and servingEasyMeasure goodput against TTFT and TPOT SLOsLLM inference and servingEasyMeasure the wasted slots of static batchingLLM inference and servingEasyRate limit API requests with a token bucketLLM inference and servingEasySize prefill and decode pools for disaggregated servingLLM inference and servingEasyGenerate one token at a time with a KV cacheLLM inference and servingMediumAllocate KV cache memory in pages, like vLLMLLM inference and servingProMediumVerify a draft model's guesses in speculative decodingLLM inference and servingProMediumIs decoding memory-bound? A roofline estimateLLM inference and servingProMediumCount prefix cache hits with a token trie and block granularityLLM inference and servingProMediumEvict KV cache blocks with an LRU policyLLM inference and servingProMediumGather a paged KV cache through a block tableLLM inference and servingProMediumRun a paged KV block allocator with a free listLLM inference and servingProMediumRoute requests to replicas by shared prompt prefixLLM inference and servingProMediumServe many LoRA adapters in one batchLLM inference and servingProMediumCompare FCFS and shortest-job-first latency for LLM requestsLLM inference and servingProMediumSimulate continuous batchingLLM inference and servingProHardSimulate a chunked prefill scheduler with a per-step token budgetLLM inference and servingProHardAccept or reject draft tokens in speculative samplingLLM inference and servingProHardSimulate KV memory preemption with recomputeLLM inference and servingProHardTrack shared KV blocks with copy-on-write for beam searchLLM inference and servingProHardStream text safely when stop sequences can span chunksLLM inference and servingProHardPer-channel vs per-tensor int8: measure the errorQuantizationEasyQuantize activations to uint8 with a scale and zero pointQuantizationEasyUnpack int4 weights from bytesQuantizationEasyQuantize with stochastic rounding from given random drawsQuantizationEasyWork out effective bits per weight and model size for group quantizationQuantizationEasyQuantize weights to int8 and measure the errorQuantizationProMediumGroup-wise int4 quantization like GPTQ and AWQ checkpointsQuantizationProMediumSearch for an activation-aware per-channel scale before int4 roundingQuantizationProMediumRound float32 to bfloat16QuantizationProMediumMigrate activation outliers with SmoothQuant scalesQuantizationProMediumMultiply int8 activations by int8 weights and dequantizeQuantizationProMediumQuantize a KV cache to int8 per token and headQuantizationProMediumBackpropagate through fake quantization with a learned scaleQuantizationProMediumSearch the clipping range that minimizes quantization errorQuantizationProMediumRun a matrix-vector product on packed 4-bit weights with zero pointsQuantizationProMediumRequantize an int32 accumulator with a fixed-point multiplierQuantizationProMediumBlock-wise 4-bit codebook quantization with double-quantized scalesQuantizationProHardQuantise a weight row GPTQ-style with error feedbackQuantizationProHardQuantize weights to 4-bit groups while keeping salient columns in floatQuantizationProHardSplit outlier features into a float matmul and the rest into int8QuantizationProHardRound float values to the FP8 E4M3 formatQuantizationProHardRotate activations with a Hadamard matrix before 4-bit quantizationQuantizationProHardLimit attention to a sliding window of recent tokensEfficient architecturesEasyCompare KV cache size for multi-head, grouped-query and latent attentionEfficient architecturesEasyCount total and active parameters of an MoE layerEfficient architecturesEasyCompute model FLOPs utilization (MFU) for a training runEfficient architecturesEasyEstimate KV cache memory with cross-layer KV sharingEfficient architecturesEasyChoose which positions stay in an attention-sink streaming cacheEfficient architecturesEasyBuild a local plus global attention maskEfficient architecturesEasyPrune weights to 2:4 structured sparsityEfficient architecturesEasyCompute savings from confidence-based early exitEfficient architecturesEasyShare keys and values across heads with grouped-query attentionEfficient architecturesProMediumRoute each token to its top 2 experts in a mixture of expertsEfficient architecturesProMediumCausal linear attention with a running stateEfficient architecturesProMediumRoute tokens with expert capacity and drop the overflowEfficient architecturesProMediumRoute tokens with Mixture-of-DepthsEfficient architecturesProMediumImplement top-k sparse attention per queryEfficient architecturesProMediumEvict KV cache entries while keeping heavy hitters and recent tokensEfficient architecturesProMediumPick the rank that keeps a target energy in a low-rank factorizationEfficient architecturesProMediumCompute the Switch Transformer load-balancing lossEfficient architecturesProHardDecode with a sliding-window KV cache stored as a ring bufferEfficient architecturesProHardMerge similar tokens with bipartite matchingEfficient architecturesProHardSelect key blocks by compressed scores, then attend inside themEfficient architecturesProHardCompute multi-head latent attention scores from the latent cacheEfficient architecturesProHardRun the gated delta rule for linear attentionEfficient architecturesProHardCount LoRA's trainable parametersFine-tuningEasyEstimate GPU memory for QLoRA-style fine-tuningFine-tuningEasyMask prompt tokens out of the SFT lossFine-tuningEasyRender chat messages into a model prompt stringFine-tuningEasySwap one merged LoRA adapter for anotherFine-tuningEasyCount trainable parameters when freezing most of a modelFine-tuningEasyLoRA forward pass and weight mergeFine-tuningProMediumAttention with trainable prefix keys and values (prefix tuning)Fine-tuningProMediumPack examples into fixed-length training rowsFine-tuningProMediumCompute a DoRA adapted weightFine-tuningProMediumWrite an SFT collate function that shifts, pads and masks labelsFine-tuningProMediumCompare token-mean and sequence-mean SFT loss reductionsFine-tuningProMediumTurn an LM head into a classifier with label wordsFine-tuningProMediumMerge several LoRA adapters into one weight with weightsFine-tuningProMediumMake gradient accumulation match one big batchFine-tuningProHardBackward pass of a LoRA layer with adapter dropoutFine-tuningProHardMerge fine-tuned models with TIESFine-tuningProHardExtract a LoRA adapter from a full fine-tune with SVDFine-tuningProHardFine-tune a classifier on the last real token's hidden stateFine-tuningProHardTrain a reward model with the Bradley-Terry lossAlignmentEasyScore a reward model by pairwise preference accuracyAlignmentEasyEstimate KL divergence from samples three waysAlignmentEasyCompute the IPO preference lossAlignmentEasyAdd label smoothing to the DPO loss (conservative DPO)AlignmentEasyCompute batched GRPO advantages and filter zero-signal groupsAlignmentEasyCompute RLOO leave-one-out baselinesAlignmentEasyCompute the DPO loss from log-probabilitiesAlignmentProMediumBuild per-token RLHF rewards with a KL penaltyAlignmentProMediumCompute the KTO loss for unpaired feedbackAlignmentProMediumCompute the SimPO lossAlignmentProMediumImplement the ORPO odds-ratio preference lossAlignmentProMediumTrain a reward model on a full ranking of K answersAlignmentProMediumGRPO: group-relative advantages with the PPO clipped objectiveAlignmentProHardFull PPO loss with GAE, advantage whitening and value clippingAlignmentProHardCompute the DPO gradient weights by handAlignmentProHardCompute a token-level clipped policy loss with asymmetric clippingAlignmentProHardCompute the DPO loss directly from policy and reference logitsAlignmentProHardSample a VAE latent with the reparameterization trickGenerative modelsEasyScore a denoising autoencoder against the clean inputGenerative modelsEasySchedule the KL weight with cyclical annealingGenerative modelsEasyScore anomalies with a tied-weight autoencoder's reconstruction errorGenerative modelsEasyInterpolate between two latent vectors with slerpGenerative modelsEasyCompute the VAE loss: reconstruction BCE plus KL to a standard normalGenerative modelsProMediumCompute GAN discriminator and non-saturating generator losses from logitsGenerative modelsProMediumRun an affine coupling layer forward and backwardGenerative modelsProMediumCompute the Inception Score from class probabilitiesGenerative modelsProMediumBuild PixelCNN mask A and mask B with colour channel orderingGenerative modelsProMediumCompute WGAN-GP critic and generator losses with an analytic input gradientGenerative modelsProHardQuantize latents to a VQ-VAE codebook with straight-through gradientsGenerative modelsProHardCompute the Frechet distance between GaussiansGenerative modelsProHardTake one discriminator and one generator step of a 1D GAN by handGenerative modelsProHardBackpropagate through the VAE reparameterization and KL termGenerative modelsProHardCut an image into flattened patches for a vision transformerVision transformers and CLIPEasyClassify images zero-shot with CLIP embeddingsVision transformers and CLIPEasyReassemble an image from ViT patch vectorsVision transformers and CLIPEasyCount ViT tokens, attention cost and patch embedding sizeVision transformers and CLIPEasyEmbed patches, prepend a CLS token and add position embeddingsVision transformers and CLIPProMediumCompute CLIP's symmetric image-text contrastive lossVision transformers and CLIPProMediumMask patches for a masked autoencoderVision transformers and CLIPProMediumBuild 2D sine-cosine position embeddingsVision transformers and CLIPProMediumPartition a feature map into (shifted) windows for window attentionVision transformers and CLIPProMediumEvaluate CLIP-style image-text retrieval with recall at kVision transformers and CLIPProMediumClassify an image from the CLS token after one multi-head attention blockVision transformers and CLIPProHardResize learned ViT position embeddings for a new input resolutionVision transformers and CLIPProHardCompute attention rollout for a ViTVision transformers and CLIPProHardBuild the attention mask for shifted window attentionVision transformers and CLIPProHardAdd noise to an image in one jump: q(x_t | x_0)Diffusion modelsEasyCombine conditional and unconditional noise with classifier-free guidanceDiffusion modelsEasyCompute Min-SNR loss weightsDiffusion modelsEasyBuild the Karras noise scheduleDiffusion modelsEasyClip predicted clean images with dynamic thresholdingDiffusion modelsEasyChoose the starting step and noise the input for image-to-imageDiffusion modelsEasyBuild the cosine noise scheduleDiffusion modelsProMediumBuild a linear beta schedule and find where signal-to-noise drops below 1Diffusion modelsProMediumConvert between v-prediction and x0/epsilonDiffusion modelsProMediumCompute the forward-process posterior q(x_{t-1} | x_t, x_0)Diffusion modelsProMediumApply classifier-free guidance with guidance rescaleDiffusion modelsProMediumTake one DDPM denoising stepDiffusion modelsProHardRun a deterministic DDIM sampler over a strided timestep subsequenceDiffusion modelsProHardTake a Heun (2nd order) step of the diffusion ODEDiffusion modelsProHardTake one DDIM step with stochasticity etaDiffusion modelsProHardSample with the Euler ancestral method over a sigma scheduleDiffusion modelsProHardCompute discounted returns for an episodeReinforcement learningEasyRun an epsilon-greedy multi-armed bandit from fixed random drawsReinforcement learningEasyPick the next arm with the UCB1 ruleReinforcement learningEasyCompute n-step bootstrapped returnsReinforcement learningEasyCompute Double DQN targetsReinforcement learningEasyDo one Bellman expectation backup for a single stateReinforcement learningEasyBuild linear and exponential epsilon decay schedulesReinforcement learningEasyUpdate a value table with TD(0) over an episodeReinforcement learningEasyCompute one-step actor-critic advantages and lossesReinforcement learningEasyTurn MCTS visit counts into a move policy with temperatureReinforcement learningEasyMask illegal moves out of a policy head's softmaxReinforcement learningEasyAdd potential-based reward shaping to an episodeReinforcement learningEasyRun tabular Q-learning updatesReinforcement learningProMediumPick the next move in MCTS with the PUCT ruleReinforcement learningProMediumCompute a REINFORCE policy-gradient update with a baselineReinforcement learningProMediumBack up a playout value through an MCTS path with alternating playersReinforcement learningProMediumRun tabular SARSA updates over an episodeReinforcement learningProMediumCompute soft state values for maximum-entropy RLReinforcement learningProMediumUpdate a gradient bandit's action preferencesReinforcement learningProMediumRun Gaussian Thompson sampling from fixed noise drawsReinforcement learningProMediumEstimate state values with first-visit Monte CarloReinforcement learningProMediumCompute the DQN loss with a target network and Huber lossReinforcement learningProMediumCompute prioritized replay sampling probabilities and importance weightsReinforcement learningProMediumFind a Go group and count its liberties with flood fillReinforcement learningProMediumEstimate a policy's return from another policy's episodes with importance samplingReinforcement learningProMediumUpdate a search distribution with the cross-entropy methodReinforcement learningProMediumCompute Generalized Advantage EstimationReinforcement learningProHardSolve a slippery gridworld with value iterationReinforcement learningProHardSearch a game tree with negamax and alpha-beta pruning, counting visited leavesReinforcement learningProHardSolve a small MDP with policy iterationReinforcement learningProHardRun TD(lambda) with accumulating and replacing eligibility tracesReinforcement learningProHardBuild a sum tree and sample replay indices from itReinforcement learningProHardRun PPO epochs with the clipped objective and KL early stoppingReinforcement learningProHardPlay a Go move with captures and the suicide ruleReinforcement learningProHardFind the best tic-tac-toe move with depth-aware minimaxReinforcement learningProHardTotal the tokens each model used on successful API callsSQLEasyFind users whose total API spend is over a budget with HAVINGSQLEasyCount how many different models each user called with COUNT DISTINCTSQLEasyPick a final label from human and model labels with COALESCESQLEasyFind training runs that were never evaluated with a LEFT JOIN anti-joinSQLEasyCompute the prompt cache hit rate per model while ignoring unknown rowsSQLEasyShow each team's share of total GPU hours with a window over all rowsSQLEasyCount failed training runs per project, keeping projects with zero failuresSQLMediumPick the best scoring model for each eval task with ROW_NUMBERSQLMediumPivot request statuses into columns with conditional aggregationSQLMediumFind eval tasks where a candidate model scores below the baseline with a self joinSQLMediumKeep every run in the top two distinct scores per project with DENSE_RANKSQLMediumKeep the latest annotation per item, then count labelsSQLMediumMeasure how many days each model version stayed live with LEADSQLMediumFind models slower than the overall average latency using CTEsSQLMediumCompute day-over-day percent change in API cost per team with LAGSQLProHardSplit agent events into sessions by idle gap and report sessions per userSQLProHardBuild a three-step signup funnel where steps must happen in orderSQLProHardCompute day-1 and day-7 retention per signup cohortSQLProHardCompute the median latency per model with window functionsSQLProHardFind the longest streak of consecutive failed runs per pipelineSQLProHardFind the day each user crossed a token quota with a running totalSQLProHardSummarise API calls per model with named groupby aggregationspandasEasyKeep only the latest subscription record per userpandasEasyMelt a wide leaderboard into long rows and drop missing scorespandasEasyCompare class balance across train, val and test with value_countspandasEasyCount prompts per tag by exploding a list columnpandasEasyJoin usage to a price table and fill missing prices with a defaultpandasMediumPivot repeated eval runs into a model by benchmark score tablepandasMediumAudit eval coverage with an outer merge and the indicator columnpandasMediumFill missing latencies with each model's median and a global fallbackpandasMediumForward fill each user's plan in time order without leaking across userspandasMediumPrice API requests with marginal token tiers using vectorized NumPy instead of applypandasMediumAdd each request's share of its user's tokens and its rank with groupby transformpandasMediumCompute a 3-day calendar rolling error rate per model with gaps in the datapandasProHardResample a request log to hourly traffic, filling empty hours with zerospandasProHardFlag metric spikes with a rolling z-score of the previous values per modelpandasProHardBuild a monthly cohort retention matrix with pandaspandasProHardPrice each API call with the rate in effect at that time using merge_asofpandasProHardword2vec skip-gram negative sampling loss (Mikolov et al., 2013)Paper implementationsEasyCompute-optimal model and data size with a Chinchilla-style rule of thumbPaper implementationsEasyEvaluate the Chinchilla scaling lawPaper implementationsEasyBuild a global magnitude pruning maskPaper implementationsEasyCompute the SwiGLU feed-forward hidden size used by LlamaPaper implementationsEasyAdd the z-loss auxiliary term to cross-entropyPaper implementationsEasyApply tanh soft-capping to logits and get its gradientPaper implementationsEasyKnowledge distillation loss with temperature (Hinton et al., 2015)Paper implementationsProMediumALiBi linear attention biases (Press et al.) instead of position embeddingsPaper implementationsProMediumMix a batch with mixupPaper implementationsProMediumCompute a multi-token prediction loss over several headsPaper implementationsProMediumRun a self-refinement loop with a stopping rulePaper implementationsProMediumFlashAttention-style tiled causal attention forward (Dao et al., 2022)Paper implementationsProHardMamba-style selective state-space scan with zero-order-hold discretizationPaper implementationsProHardImplement recurrent retention from RetNetPaper implementationsProHardImplement differential attention with the lambda reparameterizationPaper implementationsProHardSimulate a parallel tree reductionGPU kernels (simulated)EasyCount memory transactions for a warp's global loadsGPU kernels (simulated)EasyPredict attainable FLOPs with the roofline modelGPU kernels (simulated)EasyMeasure warp divergence from branch outcomesGPU kernels (simulated)EasyLaunch an elementwise kernel with the right grid size and bounds checkGPU kernels (simulated)EasyCount the work each thread does in a grid-stride loopGPU kernels (simulated)EasyMeasure wave quantization of a tiled kernelGPU kernels (simulated)EasyEstimate memory traffic saved by fusing elementwise kernelsGPU kernels (simulated)EasyCount global memory loads for naive vs tiled matmulGPU kernels (simulated)ProMediumCalculate SM occupancy from threads, registers and shared memoryGPU kernels (simulated)ProMediumReduce a warp with butterfly XOR shufflesGPU kernels (simulated)ProMediumFind the argmax with a parallel tree reduction and lowest-index tiesGPU kernels (simulated)ProMediumSimulate a warp-per-row matrix-vector kernelGPU kernels (simulated)ProMediumMerge split-KV partial attention resultsGPU kernels (simulated)ProMediumCompute a matmul with split-K partial sumsGPU kernels (simulated)ProMediumCount atomic serialization in a warp-level histogramGPU kernels (simulated)ProMediumMap program ids to tiles with grouped ordering for cache reuseGPU kernels (simulated)ProMediumMerge per-thread mean and variance statistics in a blockGPU kernels (simulated)ProMediumOnline softmax, the trick inside FlashAttentionGPU kernels (simulated)ProHardCount shared-memory bank conflict passes per warpGPU kernels (simulated)ProHardSimulate a work-efficient parallel prefix sumGPU kernels (simulated)ProHardSimulate a multi-stage load and compute pipelineGPU kernels (simulated)ProHardCompute dK and dV tile by tile from the saved log-sum-expGPU kernels (simulated)ProHardAverage gradients across data-parallel workersDistributed trainingEasyCompute the idle bubble fraction of a pipeline-parallel scheduleDistributed trainingEasyPick gradient accumulation steps for a global batchDistributed trainingEasyCompare ring and tree all-reduce with a latency-bandwidth modelDistributed trainingEasyEstimate peak parameter memory for fully sharded training with prefetchDistributed trainingEasyApply an outer momentum step after local SGD roundsDistributed trainingEasyChoose a checkpoint interval that minimizes activation memoryDistributed trainingEasySimulate ring all-reduce step by stepDistributed trainingProMediumEstimate per-GPU memory under ZeRO stages 0 to 3Distributed trainingProMediumEstimate per-step communication for DP, ZeRO and TPDistributed trainingProMediumShard flattened parameters across ranksDistributed trainingProMediumGroup gradients into all-reduce buckets in backward orderDistributed trainingProMediumBuild the all-to-all send matrix for expert parallelismDistributed trainingProMediumSimulate a dynamic loss scaler for mixed-precision trainingDistributed trainingProMediumSplit an MLP across GPUs with tensor parallelismDistributed trainingProHardSimulate a GPipe-style schedule with uneven stage timesDistributed trainingProHardGenerate a 1F1B pipeline scheduleDistributed trainingProHardSplit attention heads across GPUs with tensor parallelismDistributed trainingProHardCompute cross-entropy when the vocabulary is split across GPUsDistributed trainingProHardSimulate a two-level hierarchical all-reduceDistributed trainingProHardCompress gradients with top-k and error feedbackDistributed trainingProHardParse a ReAct agent's action from model outputAgentsEasyTrim an agent's chat history to fit a token budgetAgentsEasyDetect a repeating tool-call loopAgentsEasyRoute a request to a tool by keyword scoreAgentsEasyCompute full-jitter and equal-jitter retry delaysAgentsEasyTruncate a long tool result to a token budget keeping head and tailAgentsEasyMeasure agent reliability with pass^kAgentsEasyDeduplicate repeated tool calls with a canonical cache keyAgentsEasyWrite the loop that runs a tool-calling agentAgentsProMediumRetry a flaky tool with exponential backoffAgentsProMediumExtract a JSON tool call from messy model outputAgentsProMediumEnforce token and dollar budgets on an agent runAgentsProMediumRetrieve agent memories by similarity and recencyAgentsProMediumRedact emails, phone numbers and card numbers before text reaches a modelAgentsProMediumValidate tool arguments against a schema before callingAgentsProHardSchedule an agent's task plan into parallel waves with cycle detectionAgentsProHardCompact an agent's message history under a token budgetAgentsProHardRepair a truncated JSON tool call from a streaming modelAgentsProHardParse a full multi-step ReAct trace into structured stepsAgentsProHardFind the latency and critical path of an agent's task planAgentsProHardSchedule tool calls under global and per-tool concurrency limitsAgentsProHardDetect feature drift with the Population Stability IndexMLOpsEasyReport p50, p95 and p99 latency with the nearest-rank methodMLOpsEasyBump a semantic model versionMLOpsEasyFlag stale features in a feature storeMLOpsEasyMeasure agreement between a shadow model and productionMLOpsEasyCompute SLO error budget burn ratesMLOpsEasyRaise drift alerts with an EWMA control chartMLOpsEasyValidate a data batch against a schema with null-rate, type and range checksMLOpsEasyCatch train-serving skew in feature pipelinesMLOpsProMediumDrive a staged canary rollout from per-window error ratesMLOpsProMediumPick a champion model with guardrail metricsMLOpsProMediumMeasure feature drift with smoothed KL divergence on quantile binsMLOpsProMediumAssign users to experiment variants with salted hash bucketingMLOpsProMediumDetect drift in a categorical feature with a chi-square statisticMLOpsProMediumTwo-sample Kolmogorov-Smirnov statistic for drift alertsMLOpsProHardJoin training labels to features without leaking the futureMLOpsProHardSimulate a circuit breaker in front of a model APIMLOpsProHardApply stage transitions in a model registryMLOpsProHardPro problems are Pro.
Browse by topic
- NumPy foundations 23
- Linear algebra 14
- Calculus and gradients 14
- Probability and statistics 20
- Data processing and features 29
- Regression 18
- Supervised models 18
- Unsupervised learning 15
- Evaluation metrics 26
- Time series 16
- Recommender systems 21
- Activations 13
- Losses 12
- Optimizers 17
- Neural networks 18
- Autograd 11
- Normalization 11
- Computer vision 30
- Sequence models 18
- Tokenization and NLP 29
- Embeddings and RAG 17
- Attention and transformers 21
- Sampling and decoding 15
- LLM inference and serving 28
- Quantization 22
- Efficient architectures 23
- Fine-tuning 19
- Alignment 18
- Generative models 15
- Vision transformers and CLIP 14
- Diffusion models 16
- Reinforcement learning 35
- SQL 22
- pandas 17
- Paper implementations 16
- GPU kernels (simulated) 23
- Distributed training 21
- Agents 21
- MLOps 18
Study plans and mocks
Study plan · 4 weeksAI Engineer in 4 weeks24 steps, week by weekStudy plan · 6 weeksML Engineer in 6 weeks25 steps, week by weekStudy plan · 3 weeksLLM internals in 3 weeks15 steps, week by weekTimed mock · 45 minML Engineer mock assessment3 coding problems and 6 concept questions, scoredTimed mock · 40 minAI Engineer mock assessment3 coding problems and 6 concept questions, scoredAdvanced track · 11 problemsLLM architecture from the insideGQA, sliding windows, MoE routing, RoPE, RMSNorm, KV cache, speculative decoding, int8