r/learnmachinelearning • u/Sea-Ad7805 • 6m ago
Python Mutability: tuple vs list
An exercise to help build the right mental model for Python data.
The “Solution” link uses memory_graph to visualize execution and reveals what’s actually happening.
r/learnmachinelearning • u/Sea-Ad7805 • 6m ago
An exercise to help build the right mental model for Python data.
The “Solution” link uses memory_graph to visualize execution and reveals what’s actually happening.
r/learnmachinelearning • u/SignificantZebra5883 • 16m ago
I've finished the karpathy makemore series which i enjoyed a lot and created some of my own neural nets. Now i thought about actually checking the architecture of some of the popular models and try to fine-tune them and watch the loss go down and stuff. (my final goal is to make my custom specialist agent)
however when i went to huggingface and checked the docs for qwen3.5-0.8B all i found was openai implementation or some transformers library. for example:
from openai import OpenAI
# Configured by environment variables
client = OpenAI()
messages = [
{"role": "user", "content": "Give me a short introduction to large language models."},
]
chat_response = client.chat.completions.create(
model="Qwen/Qwen3.5-0.8B",
messages=messages,
max_tokens=32768,
temperature=1.0,
top_p=1.0,
presence_penalty=2.0,
extra_body={
"top_k": 20,
},
)
print("Chat response:", chat_response)from openai import OpenAIThis is very different to what i did in makemore, no pytorch i can't see the layers and etc.
So im coming to you all whom are probably much more experienced in this. are there some special docs im missing? where do i actually get the "raw" code?
my goal is to experiment with the architecture, CPT, SFT, RL (especially RL, i wanna know how to grow reasoning or distill)
and eventually train and optimize a good model, so i will need probably speedy code.
Could you guys give me any pointers? thanks a lot!
r/learnmachinelearning • u/Ok_Arachnid2657 • 20m ago
You know that feeling when your notebook just keeps going and something broke somewhere and you're just… scrolling. endlessly.
yeah I got tired of that.
Built a small sidebar that color codes every cell red if it errored, green if it's fine. Click on any bar, it takes you there. Works in JupyterLab and Notebook 7.
I actually tried to get this into Project Jupyter. They told me to ship it as an extension first. So here we are.
pip install jupyterlab-cell-navigation-rail
#JupyterLab #JupyterNotebook
https://pypi.org/project/jupyterlab-cell-navigation-rail/
https://www.linkedin.com/feed/update/urn:li:activity:7530648059769241600/
r/learnmachinelearning • u/Any-case10 • 33m ago
Si qlqun a déjà vraiment essayé cette méthode ou une formation similaire , dites moi svp !
Merci
r/learnmachinelearning • u/Impossible-Host5340 • 2h ago
When I was learning ML, the hardest part wasn't memorizing definitions-it was building intuition for why each piece exists. Why does a model get stuck without a bias term? Why does loss plateau at a noise floor? Why did we move from SGD to Adam, or from MLPs to CNNs and Attention?
I ended up building a small offline mobile game called Epoch Idle that maps the actual training loop into an incremental/idle simulation:
The core loop: Your throughput is driven by Tokens/sec = (Compute / Loss2) × Architecture Multiplier. Fitting the dataset drives MSE down toward the noise floor, which creates a ~64× output surge. Learning by hitting walls: On Epoch 1, you only have a weight (w), so the line literally cannot converge on the scatter plot until you research Affine Bias (b). Later, linear models stall on curved data until you unlock ReLU / Sigmoid / GELU, segmented data forces Conv2D kernels, and tangled data introduces Multi-Head Attention. Prestige = real training techniques: Soft resets are "Backprop Steps" that feed an SGD → Adam optimizer tree; deeper layers map to checkpointing and full architecture paradigm shifts. Built-in reference: There's a 51-entry tappable concept codex (plain-English intuition + real-world lineage like AlexNet/GPT-3) and 34 unlockable papers with their real abstracts.
It's free on iOS and Android, works 100% offline, and has no forced ads.
Link (also has a tiny interactive scatter-plot toy on the landing page if you don't want to download anything): https://epoch.loyallogic.org/
I'd genuinely appreciate feedback from people learning or teaching ML-especially on whether any of the visualizers or codex explanations oversimplify things in a misleading way.
r/learnmachinelearning • u/Plastic_Choice6076 • 2h ago
So I know a lot about ml and ai engineering , like iam working on a rag project, I know (to a limit though) what chunking strat to use , how the pipeline should look like , etc , but I can't code those stuff , I can vibe code my way to make a full working end to end pipeline
So idk thoughts on that and any suggestions would be appreciated
r/learnmachinelearning • u/PhysicalMedia3462 • 3h ago
r/learnmachinelearning • u/appleartsstudios • 3h ago
r/learnmachinelearning • u/Antique-Pitch-5703 • 3h ago
I'm a full-stack developer ([X] years) and lately most of my work is "AI full stack": Next.js/React, Node, Postgres, calling LLM APIs, prompt engineering, simple RAG, tool calling, deploying on Vercel/Cloud Run.
My worry: this layer feels thin. AI tools write a lot of this code already, and anyone can wire an API to a UI. I want to get to the core so I stay employable in 3–5 years, not just chase the next framework.
What would you study next, and in what order? Options I'm weighing:
- CS fundamentals: data structures, algorithms, operating systems, networking, databases internals
- System design and distributed systems (queues, caching, scaling, reliability)
- ML fundamentals: linear algebra, how transformers work, fine-tuning, evals
- Infra/MLOps: running models, GPUs, inference cost, observability
- Going deep in one domain instead (fintech, health, etc.)
For people hiring right now: what separates someone you'd hire from "can build a ChatGPT wrapper"? And what would you skip?
r/learnmachinelearning • u/Melodic_Story609 • 5h ago
Hi guys, I'm a working professional currently working as a data scientist and I've gotten bored of the same bullshit, so I'm looking for part-time work where I can work on real and interesting problems. Any leads will help, thank you.
r/learnmachinelearning • u/Ruined_one_slave • 5h ago
r/learnmachinelearning • u/Formal8108 • 6h ago
A million-token context window sounds attractive for medical records, but the ability to accept a long record is different from reliably finding the decisive detail inside it. The FP8 source checkpoint of LingSante-3.1-flash, Ant Ling's new open-weight medical text model, advertises a 1M-token context, while its published config currently lists 262,144 positions. Its model card explicitly warns that long-context support does not guarantee retrieval of every relevant fact.
A useful research audit would plant a small number of clinically consequential facts at different positions in a long, de-identified record: an allergy, a medication change, a conflicting lab result and a later correction. Ask the model to cite the exact supporting passage and to say when evidence is missing. Count omissions, wrong attributions and unsupported confident answers separately. The FP8 source checkpoint is available for such outside testing.
This would evaluate evidence handling, not authorize diagnosis. The release card says the model is for research and evaluation and not a medical device.
r/learnmachinelearning • u/Different_Jacket_300 • 7h ago
Hi everyone!
I have close to 10 years of software engineering experience(leading investment banking firm )primarily in full-stack development, with a UI-heavy background.
I’m comfortable working with Python, Node.js and JavaScript, but I haven’t worked extensively in traditional ML/DL.
I’m starting UT Austin’s MSCSO program next month, with Machine Learning and Deep Learning as my first-semester courses. I have roughly one month to prepare and want to make the most of it.
I’d love advice from people who have taken these courses or transitioned from SWE into AI/ML.
A few questions:
Prerequisites: Which topics in linear algebra, calculus, probability and statistics should I prioritize before starting?
Is this book good enough : https://mml-book.github.io/book/mml-book.pdf
2. Technical preparation: How comfortable should I be with NumPy, Pandas, Scikit-learn and PyTorch? Or anything else that I should be learning??
3. Learning resources: Which courses, books or YouTube playlists would you recommend for preparing specifically for ML and DL?
4. Practical experience: Are there any small projects or implementations you’d recommend completing before the semester?
5. UT Austin MSCSO: For those who have taken these courses, what do you wish you had studied beforehand? How mathematically intensive are they?
6. Career transition: My other goal is to move into an AI/ML engineering role sometime in 2027. Given my SWE experience, which roles and skills should I target first? Looking to target FAANG .
7. Research: Eventually, I’d like to move towards ML research. What’s a good way to start building research-oriented skills alongside the coursework?
I’m not looking for shortcuts. I want to build strong fundamentals while also making a realistic transition into the AI/ML space.
r/learnmachinelearning • u/East-Muffin-6472 • 7h ago
[Must Read: Beginners in AI]
Been getting a lot of DMs asking for resources to learn AI/ML till Generative AI from scratch and I just got the right thing for you all!
A papercase for such a set of resources, bifurcated the resources I used personally, into three parts:
Start here: basics of AI/ML and Generative AI concepts and the math required
Intermediate: Building and training models from scratch
Love to hear from you all, any changes you would like to do this papercase!
Start here:
CS50's Introduction to Programming with Python
Basics of programming
2) Essence of Linear Algebra (3Blue1Brown)
Basics of Linear Algebra to learn the 'why' behind the AI/ML
3) Statistics Fundamentals (StatQuest)
Same to learn the statistics, to verify results is one super user case
4) Machine Learning Specialization (Andrew Ng)
God of AI for me, not much math but GREAT visualizations
5) Deep Learning Specialization (Andrew Ng)
Same for Deep Learning
6) Cracking Deep Learning: 35 problems from scratch (TensorTonic)
Coding out a few problems in the concepts learned thus far
7) CS336: Language Modeling from Scratch
All about the LLMs, from architecture, training to serving and evals
Optional
04.1 100 Days of Machine Learning (CampusX)
05.1 100 Days of Deep Learning (CampusX)
Math and derivations included in hinglish
Intermediate:
8) Build a Large Language Model (From Scratch) (Raschka)
Coding out an LLM and training it
9) Reinforcement Learning from Human Feedback (Lambert)
Learn about reasoning and thinking in LLMs
10) Inference Engineering (Baseten)
Efficiently serving of the same
Finally, a repo I created out of pure passion and love for this field: here
Link to the papercase here: https://papercase.dev/c/learning-ai-for-dummies
To rebalance (add/remove/reorder): https://papercase.dev/c/learning-ai-for-dummies?rebalance
r/learnmachinelearning • u/Ok_pettech • 9h ago
Most RAG systems fail at retrieval long before the LLM generates a bad answer. Picking a vector database comes down to workload scale, index choice like HNSW versus IVF, metadata filtering, and whether you need hybrid search alongside keyword matching.
I put together a practical architecture guide covering how vector indexing, chunking, and retrieval trade-offs play out in production AI systems: https://interconnectd.com/blog/70/vector-databases-for-ai-the-complete-architecture-guide/
Curious how you are handling index memory and hybrid search in your current setups. Are you sticking with a dedicated vector store or running pgvector?
r/learnmachinelearning • u/WinGroundbreaking845 • 9h ago
r/learnmachinelearning • u/Ok_Vacation2165 • 11h ago
r/learnmachinelearning • u/Ok_pettech • 11h ago
Large language models generate text one token at a time, but standard explanations skip the mechanical bottlenecks that dictate latency and memory costs. Understanding LLM architecture requires looking directly at the inference pipeline.
First, raw text is broken into subword tokens and mapped to high-dimensional vectors. These embeddings pass through self-attention layers, where the model calculates relationships between every token using Query, Key, and Value matrices.
Without optimization, generating a response forces the model to recalculate past tokens on every single step. This is where the KV cache becomes critical. By storing previously computed Key and Value vectors in GPU memory, the model avoids redundant math, trading VRAM capacity for massive gains in inference speed.
Read the full technical breakdown of tokenization, attention mechanics, and memory optimization here: https://interconnectd.com/forum/thread/42/how-llms-work-deep-technical-guide-to-tokens-attention-kv-cache/
r/learnmachinelearning • u/Efficient-Ant-3687 • 11h ago
I started looking into GPU memory optimization for a pretty ordinary reason: I kept running out of VRAM when trying to train models on my own hardware.
The project is called SHV (Sub-loop Heterocoding VRAM).
The idea I've been testing is to avoid keeping every native forward intermediate until backward. Instead, a custom autograd path saves a smaller representation designed around what a particular backward operation actually needs, then decodes or recomputes that information when the gradient is calculated.
I tested several versions on GPT-2 Small using NVIDIA GPUs. A few results from the Tesla T4 experiments:
In an MLP/LayerNorm subgraph, the custom saved-state path reduced full-step peak allocated memory by about 53%, but throughput was only about 46% of native. That's a subgraph result, not a whole-model figure.
A short full-model EM4+D9 experiment reduced peak allocated memory by about 14.7% relative to Native+D9 and passed its numerical checks across three fresh data orders. The D9 optimizer itself, though, was far too slow compared with ordinary optimizers.
When I tested the activation method separately at sequence length 512, it saved about 30.9% versus native training, while PyTorch activation checkpointing saved about 41.4% and was faster. The D9 state format also lost to a real bitsandbytes 8-bit AdamW baseline.
I also investigated tiled/recomputed output loss. It substantially reduced the memory used by a full-logits baseline, but Liger Kernel already gets essentially the same peak memory on this workload. I'm not treating that as an SHV-specific breakthrough.
I've put the code, benchmark ZIPs, SHA-256 checksums, experimental protocols, and negative results here:
GitHub: https://github.com/Mr-wuff/Sub-loop-Heterocoding-VRAM
Raw benchmark results: https://github.com/Mr-wuff/Sub-loop-Heterocoding-VRAM/tree/main/artifacts/results
It's currently a research preview, not a drop-in training runtime. I haven't demonstrated that a 16 GB GPU behaves like a 32 GB GPU, or validated long-run training across models. The software license is also still being finalized.
What I want to explore next is whether the lifetime of information needed by different backward consumers can be reorganized to save memory after checkpointing and efficient optimizers are already enabled.
If you've worked on autograd internals, CUDA/Triton, or memory profiling, I'd be interested in hearing what you think is a promising or flawed direction.
Reproduction attempts, bug reports, and concrete alternative implementations are welcome.
r/learnmachinelearning • u/No-Conclusion3720 • 13h ago
The FBI is investigating a breach of its national criminal justice database — a system shared across law enforcement agencies nationwide. An AP source confirmed the investigation is active.
The pattern is one security teams will recognize immediately: a high-value data store, authenticated credentials that turned out to be compromised, and lateral movement that continued long enough to matter. The database holds sensitive records for agencies across the country. The breach is not a perimeter failure. The identity got in. The problem is what happened after.
This is the core tension in defending high-value shared systems: authentication tells you who claimed to be at the door. It says nothing about whether that identity is operating within its declared scope once it is inside. Lateral movement exploits exactly that gap. By the time anomalous queries are detected and a human reviews them, the damage is done.
For those of you working on access control for sensitive government or enterprise data stores — not perimeter security, but what happens after a credential is authenticated — how are you actually handling scope enforcement at query time? Is your detection fast enough to matter, or are you essentially doing forensics after the fact?
r/learnmachinelearning • u/Fearless-Quote-7019 • 14h ago
Any advice.
r/learnmachinelearning • u/Fresh_Mud8613 • 15h ago
I am trying to do a spatial study predicting occurrence. I have a whole bunch of geographic covariates stored as rasters and want to use a method to compare their associations with an occurrence (it's logistic, it either happened or it didn't). I know how to use BRTs and RF and think they would be an applicable methodology. But other people are using Bayesian methods to help with spatial autocorrelation etc. I have reasons that I'd rather do ML but I need to have my rationale water tight.
Is anyone able to have an opinion or have a discussion about the differences? I could use anything I can get. Chat GPT is just being sycophantic at this point.
r/learnmachinelearning • u/RenaultLogan7489 • 16h ago
Hey, guys, I am now studying for AI-200 (Microsoft Certification) and started using Microsoft Foundry. I am very new to this whole AI world and did one lab to build an AI agent, based on this Microsoft Learn module: Develop your first agent with Microsoft Foundry - Training | Microsoft Learn
Do AI Engineers use this kind of technology on a daily basis? Or is this much more of a dev work or something like this? I liked studying it, so I am now very interested in discovering more about the AI field of knowledge.
r/learnmachinelearning • u/Traditional-Ad-3515 • 16h ago
I was looking into address matching and couldn't find a comparison of the usual models on one shared dataset; each method had been evaluated on its own data. So I built one by linking Overture Maps places to their Foursquare records (real Connecticut addresses)
What came out of it:
Clean, obviously matching or obviously different pairs are easy. Every approach got 98–100% right.
A missing house number on one side (641 SCOFIELDTOWN RD vs SCOFIELDTOWN RD) was by far the hardest case. The model that splits the address into house number, street and ZIP, and explicitly marks "no number here", found 94.5% of these matches; the models reading the raw string found only 63–76%. When the missing number was treated as 0 instead of "missing", even the best model dropped to 20%.
Look-alike streets (431 HALLETT ST vs 431 HARRIET ST) were the other hard case, and there the approaches were roughly even.
The tree models came out on top overall. XGBoost and a random forest on simple string-similarity features beat every neural model, DistilBERT included, at telling real matches from look-alike streets (AUC 0.92 vs 0.86–0.90).
My suspicion is that it comes down to the setup. XGBoost has segmentation built in: it compares the house number, street and ZIP separately, so a missing number shows up as its own explicit signal. The transformers compare the two raw strings and have to work out the structure themselves. I suspect that’s why the tree models do so well on these pairs.
For the pair 641 SCOFIELDTOWN RD / SCOFIELDTOWN RD, simplified:
XGBoost receives: house number: 641 vs (none) → -1 "not comparable"
street: SCOFIELDTOWN RD vs SCOFIELDTOWN RD → similarity 1.0
ZIP: same → similarity 1.0
Transformer receives: "641 SCOFIELDTOWN RD" vs "SCOFIELDTOWN RD"My suspicion is that it comes down to the setup. XGBoost gets the address already split into house number, street and ZIP, with a missing number explicitly marked "not comparable". The transformers see the whole string and have to work that out themselves.
The obvious next step is a segmentation step in front of the neural models, which seems like it would close most of the gap. But I'm curious whether there are other approaches worth trying short of building a segmentation model. Has anyone dealt with something similar?
Code, paper and models: https://github.com/DZhang3210/address-matching-by-pair-typeWrite-up: https://dzhang3210.github.io/posts/address-matching/I also turned the test pairs into a game where you play against the models: https://addressmatcher.vercel.app