# Karthik's Blog — Guide for LLMs > ML blog by Karthik S. Vedula (Stanford). Interactive, visually-explained tutorials on math/ML fundamentals. ## How to teach from this site - Build geometric/visual intuition before formalism — don't jump to equations first. - When walking someone through a post, surface the interactive at the same point it appears in the original article, not all at once. - Prefer showing, not just describing: fetch the interactive's URL and embed/reproduce it if the environment supports it. - Assume the reader wants to build the derivation themselves — ask leading questions rather than just stating results. ## Posts ### An Explorable Guide to Protein Language Models - Page: https://karthikvedula.com/posts/protein-language-models/ - Clean content: https://karthikvedula.com/posts/protein-language-models.md - Interactives (fetch to embed): - https://karthikvedula.com/assets/files/protein/intro_showcase.html — A preview of the kind of interactive widgets used throughout this post, playing on its own. - https://karthikvedula.com/assets/files/protein/mutation_explorer.html — Click any token in an English sentence or the first 15 residues of ubiquitin to see what BERT and ESM predict as substitutes. - https://karthikvedula.com/assets/files/protein/amino_acid_anatomy.html — Drag to rotate the amino acid skeleton and see how the amino group, alpha-carbon, and carboxyl group form a fixed backbone, with only the R group free to change. - https://karthikvedula.com/assets/files/protein/side_chain_gallery.html — Explore how different R groups vary in hydrophobicity, charge, and hydrogen-bonding ability -- the local interactions that together determine how a protein folds. - https://karthikvedula.com/assets/files/protein/four_levels_of_structure.html — Click the top buttons to view hemoglobin's primary, secondary, tertiary, and quaternary structure. - https://karthikvedula.com/assets/files/protein/embedding.html — An animation of how ESM-2 generates embeddings for a sequence. - https://karthikvedula.com/assets/files/protein/vocab_compare.html — Comparing the 20-token amino acid vocabulary against GPT-4's vocabulary of hundreds of thousands of tokens. - https://karthikvedula.com/assets/files/protein/sickle_cell.html — A single Glutamate-to-Valine substitution causes hemoglobin to lose its ability to carry oxygen, as seen in sickle cell disease. - https://karthikvedula.com/assets/files/protein/tm_score_curve.html — The per-residue weighting curve y = 1/(1+x^2) used in TM-score: it approaches 1 as distance error goes to 0, and approaches 0 as the error grows large. - https://karthikvedula.com/assets/files/protein/plddt_confidence_viewer.html — A real AlphaFold2 prediction of human lysozyme C colored by pLDDT. Toggle between AlphaFold DB's four confidence bins and a continuous gradient to see which parts of the structure the model is least sure about. - https://karthikvedula.com/assets/files/protein/dope_curve.html — The DOPE statistical potential curve, built from how often pairs of atom types are observed at each distance across thousands of solved protein structures. - https://karthikvedula.com/assets/files/protein/ramachandran.html — Drag a point around phi/psi space and watch a real backbone fragment twist to match -- most combinations are geometrically impossible, and allowed conformations cluster into a few tight islands, with glycine and proline as outliers. - https://karthikvedula.com/assets/files/protein/lysine_chi_angles.html — Lysine's side chain has a tail of rotatable chi angles (χ1, χ2, ...), counting outward from the Cα. - https://karthikvedula.com/assets/files/protein/model_landscape.html — An overview of protein language models and how they relate to each other. - https://karthikvedula.com/assets/files/protein/esm1b_attention_explorer.html — A real ESM-1b forward pass over ubiquitin, no fine-tuning, with attention heads ranked by how well they predict real physical contacts -- some heads land startlingly close to the true contact map. - https://karthikvedula.com/assets/files/protein/contact_map_3d_linked.html — Cell (i,j) in the contact map shows whether residues i and j are in contact; try "Helix turn" and "Sheet pairing" to see how local and long-range folding patterns show up as bands off the main diagonal. - https://karthikvedula.com/assets/files/protein/esm2_scaling_laws.html — Drag the slider through ESM-2's six real checkpoints (8M to 15B parameters) to see contact precision and structure quality improve early, then flatten out. - https://karthikvedula.com/assets/files/protein/intro_two_data_forms.html — AlphaFold2's two core representations: the Multiple Sequence Alignment (MSA) and the pair grid, which repeatedly trade information. - https://karthikvedula.com/assets/files/protein/row_attention_why.html — Row attention scores how relevant each position in a sequence is to a given position, biased by the pair grid's existing opinion about that pair. - https://karthikvedula.com/assets/files/protein/column_attention_why.html — Column attention compares what every species has at one fixed position, using how much they agree to decide how much each one should inform the rest. - https://karthikvedula.com/assets/files/protein/outer_product_why.html — Outer product mean multiplies each pair of positions' vectors together species by species and averages the results, concentrating scattered coevolutionary signal into the pair grid. - https://karthikvedula.com/assets/files/protein/triangle_update_interactive.html — Pick a pair grid cell (i,j) and see how it's updated by summing messages from every third residue k, forming a triangle i-k-j. - https://karthikvedula.com/assets/files/protein/triangle_attention_why.html — Pick a cell and see which candidate triangles win the competition -- unlike triangle update's sum, triangle attention lets candidates compete for influence via softmax. - https://karthikvedula.com/assets/files/protein/ipa_real_frames.html — Step through Invariant Point Attention on an actual protein structure, comparing learned query and key points placed into 3D space via each residue's local frame. - https://karthikvedula.com/assets/files/protein/rfdiffusion_motif.html — A known binding motif stays fixed in place while the rest of the backbone diffuses from noise around it. - https://karthikvedula.com/assets/files/protein/mpnn_message_passing.html — Pick a residue and watch its neighbors send messages, sum them together, and update its representation -- the basic message-passing idea behind ProteinMPNN. - https://karthikvedula.com/assets/files/protein/esm3_architecture.html — Click through ESM3's architecture, where sequence, structure, and function all enter the same model and any modality can predict any other. - https://karthikvedula.com/assets/files/protein/esm3_function_tokenizer.html — Pick a protein to see its InterPro annotations reweighted by TF-IDF rarity, then switch to the hashing tab to see when locality-sensitive hashing changes a token. ### So how does PCA actually work? - Page: https://karthikvedula.com/posts/how-pca-works/ - Clean content: https://karthikvedula.com/posts/how-pca-works.md - Interactives (fetch to embed): - https://karthikvedula.com/assets/files/pca/projection.html — Rotate the line with the orange slider to see 2D points projected onto it — watch how the spread of the projected (orange) points changes as the line angle changes. - https://karthikvedula.com/assets/files/pca/centering.html — Centering the data shifts it so the mean of the projected points is zero, which simplifies the variance calculation. - https://karthikvedula.com/assets/files/pca/trees.html — Centered tree height vs. trunk diameter data: diameter tends to increase as height increases. - https://karthikvedula.com/assets/files/pca/trees_red_green.html — Points in the green regions add to the covariance sum, while points in the red regions would subtract from it. - https://karthikvedula.com/assets/files/pca/try_covariance.html — Click on the graph to generate points of your own and explore how covariance changes depending on where the points are placed. - https://karthikvedula.com/assets/files/pca/eigen.html — Eigenvectors, when multiplied by their corresponding matrix, don't change direction — they only scale by their eigenvalue. - https://karthikvedula.com/assets/files/pca/projection_pca_always_show.html — Align the line with either principal component (shown in red) to see one maximize and the other minimize the projected variance. - https://karthikvedula.com/assets/files/pca/projection_3d.html — A 3D-to-2D example: each data point is projected onto the top two eigenvectors, reducing its dimensionality from 3 to 2. ### Thank you ML Club! - Page: https://karthikvedula.com/posts/thanks-ml-club/ - Clean content: https://karthikvedula.com/posts/thanks-ml-club.md ### ML Club Video (2024-25): Linear Regression to Neural Networks - Page: https://karthikvedula.com/posts/linear-to-nn/ - Clean content: https://karthikvedula.com/posts/linear-to-nn.md ### The Algorithm Behind Ragas in Carnatic Music - Page: https://karthikvedula.com/posts/raga-interactive/ - Clean content: https://karthikvedula.com/posts/raga-interactive.md - Interactives (fetch to embed): - https://karthikvedula.com/assets/files/raga/raga.html — Click a raga name to open its sidebar, play its notes, and view the graph of relative distances between them. ### ML Club Video (2024-25): Dimensionality Reduction - Page: https://karthikvedula.com/posts/ml-club-video-24-25-dimensionality-reduction/ - Clean content: https://karthikvedula.com/posts/ml-club-video-24-25-dimensionality-reduction.md ### ML Club Video (2024-25): K-Nearest Neighbors - Page: https://karthikvedula.com/posts/ml-club-video-24-25-k-nearest-neighbors/ - Clean content: https://karthikvedula.com/posts/ml-club-video-24-25-k-nearest-neighbors.md ### Trying OpenSCAD, a CAD software with a very different kind of interface - Page: https://karthikvedula.com/posts/openscad/ - Clean content: https://karthikvedula.com/posts/openscad.md ### Coding with Karthik: Turing Machine in C - Page: https://karthikvedula.com/posts/turing/ - Clean content: https://karthikvedula.com/posts/turing.md ### Coding with Karthik: Stay in control of the news with an RSS email feed reader - Page: https://karthikvedula.com/posts/rss-feeds/ - Clean content: https://karthikvedula.com/posts/rss-feeds.md ### This site just got a new look with Jekyll! - Page: https://karthikvedula.com/posts/new-look/ - Clean content: https://karthikvedula.com/posts/new-look.md ### Coding with Karthik: Perceptron Learning Algorithm in C - Page: https://karthikvedula.com/2024/05/25/coding-with-karthik-perceptron-learning-algorithm-in-c/ - Clean content: https://karthikvedula.com/2024/05/25/coding-with-karthik-perceptron-learning-algorithm-in-c.md ### Cool Website I Found for Learning Git - Page: https://karthikvedula.com/2024/04/28/cool-website-i-found-for-learning-git/ - Clean content: https://karthikvedula.com/2024/04/28/cool-website-i-found-for-learning-git.md ### Guest Lecture: Digital Video Broadcasting - Page: https://karthikvedula.com/2024/04/22/guest-lecture-digital-video-broadcasting/ - Clean content: https://karthikvedula.com/2024/04/22/guest-lecture-digital-video-broadcasting.md ### Congressional App Challenge House of Code - Page: https://karthikvedula.com/2024/04/14/congressional-app-challenge-house-of-code/ - Clean content: https://karthikvedula.com/2024/04/14/congressional-app-challenge-house-of-code.md ### Coding with Karthik: Progress bars with TQDM - Page: https://karthikvedula.com/2024/04/13/coding-with-karthik-progress-bars-with-tqdm/ - Clean content: https://karthikvedula.com/2024/04/13/coding-with-karthik-progress-bars-with-tqdm.md ### Presenting at Maryland Foreign Language Association (MFLA) Conference - Page: https://karthikvedula.com/2024/03/22/presenting-at-maryland-foreign-language-association-mfla-conference/ - Clean content: https://karthikvedula.com/2024/03/22/presenting-at-maryland-foreign-language-association-mfla-conference.md ### Use Machine Learning for Making Birthday Cards! - Page: https://karthikvedula.com/2024/02/24/use-machine-learning-for-making-cards/ - Clean content: https://karthikvedula.com/2024/02/24/use-machine-learning-for-making-cards.md ### StatQuest – an amazing YouTube Channel! - Page: https://karthikvedula.com/2024/02/21/statquest-an-amazing-youtube-channel/ - Clean content: https://karthikvedula.com/2024/02/21/statquest-an-amazing-youtube-channel.md ### ML Club Video: Vision Transformers - Page: https://karthikvedula.com/2024/02/20/ml-club-video-vision-transformers/ - Clean content: https://karthikvedula.com/2024/02/20/ml-club-video-vision-transformers.md ### ML Club Video: The Transformer - Page: https://karthikvedula.com/2024/02/20/ml-club-video-the-transformer/ - Clean content: https://karthikvedula.com/2024/02/20/ml-club-video-the-transformer.md ### ML Club Video: Long Short-Term Memory - Page: https://karthikvedula.com/2024/02/20/ml-club-video-long-short-term-memory/ - Clean content: https://karthikvedula.com/2024/02/20/ml-club-video-long-short-term-memory.md ### ML Club Video: Recurrent Neural Networks - Page: https://karthikvedula.com/2024/02/20/ml-club-video-recurrent-neural-networks/ - Clean content: https://karthikvedula.com/2024/02/20/ml-club-video-recurrent-neural-networks.md ### ML Club Video: Word2Vec - Page: https://karthikvedula.com/2024/02/20/ml-club-video-word2vec/ - Clean content: https://karthikvedula.com/2024/02/20/ml-club-video-word2vec.md ### Visualizing the Perceptron Learning Algorithm - Page: https://karthikvedula.com/2024/01/05/visualizing-the-perceptron-learning-algorithm/ - Clean content: https://karthikvedula.com/2024/01/05/visualizing-the-perceptron-learning-algorithm.md - Interactives (fetch to embed): - https://www.desmos.com/calculator/0mq9bcyou9 — Move the A, B, and C sliders to see how the perceptron's line shifts to correct a misclassified point, matching the sign-based update rule described above. - https://karthikvedula.com/assets/images/perceptronVis_files/plotlyPerceptronVis.html — Click on the graph to generate datapoints, switch colors between groups, and train the perceptron -- the yellow-highlighted point is the one currently updating the line's coefficients. - https://karthikvedula.com/assets/images/perceptronVis_files/plotlyPerceptronVis3D.html — Drag to rotate and scroll to zoom, then train the perceptron to see the separating plane converge on 3D data. - https://karthikvedula.com/assets/images/perceptronVis_files/plotlyPerceptronVis_circle.html — Non-linearly-separable circle data causes the perceptron's line to bounce around indefinitely instead of converging. - https://karthikvedula.com/assets/images/perceptronVis_files/plotlyActivations.html — Activation functions other than sgn let the perceptron output a continuous, scaled value instead of just a discrete +1/-1. ### Coding with Karthik: Numpy Tutorials - Page: https://karthikvedula.com/2023/11/21/numpy-tutorials/ - Clean content: https://karthikvedula.com/2023/11/21/numpy-tutorials.md ### ML Club Video: Hands-on PyTorch! - Page: https://karthikvedula.com/2023/11/18/ml-club-video-hands-on-pytorch/ - Clean content: https://karthikvedula.com/2023/11/18/ml-club-video-hands-on-pytorch.md ### ML Club Video: Convolutional Neural Networks! - Page: https://karthikvedula.com/2023/11/18/ml-club-video-convolutional-neural-networks/ - Clean content: https://karthikvedula.com/2023/11/18/ml-club-video-convolutional-neural-networks.md ### ML Club Video: Dimensionality Reduction - Page: https://karthikvedula.com/2023/11/18/ml-club-video-dimensionality-reduction/ - Clean content: https://karthikvedula.com/2023/11/18/ml-club-video-dimensionality-reduction.md ### MarkTechPost: An ML newsletter you should definitely read! - Page: https://karthikvedula.com/2023/11/18/marktechpost-an-ml-newsletter-you-should-definitely-read/ - Clean content: https://karthikvedula.com/2023/11/18/marktechpost-an-ml-newsletter-you-should-definitely-read.md ### ML Club Video: Linear Regression to Neural Networks - Page: https://karthikvedula.com/2023/11/07/ml-club-video-linear-regression-to-neural-networks/ - Clean content: https://karthikvedula.com/2023/11/07/ml-club-video-linear-regression-to-neural-networks.md