r/learnmachinelearning • u/vast-nate • 19d ago
r/learnmachinelearning • u/ProjectNo6044 • 20d ago
I coded the entire Transformer Architecture from scratch using ONLY pure PyTorch (No Hugging Face / No pre-built Transformer modules). Looking for feedback!
Hi everyone,
To truly master how Large Language Models work under the hood, I decided to step away from high-level libraries. I built a character-level Decoder-only GPT entirely from scratch using pure PyTorch only—meaning I did not use any pre-built Transformer layers or Hugging Face modules.
What I coded line-by-line:
- Multi-Head Self-Attention: Implemented the Q, K, V matrix multiplications and scaling from scratch.
- Causal Masking: Coded the upper-triangular mask manually to ensure causal token generation.
- Transformer Blocks: Built the residual connections, LayerNorm, and Feed-Forward networks from the ground up.
- Training Loop: Created a custom pipeline with validation splits, loss tracking, and early stopping.
I trained this small model locally on English Wikipedia extracts about AI. While it's a character-level learning project, seeing the custom loss function actually converge was incredibly rewarding.
Since I wrote every single layer myself, I know it's not production-perfect, and that's exactly why I'm sharing it! I would highly appreciate your code review, optimization tips, or advice on how to scale this custom architecture further.
GitHub Repository: https://github.com/YassenAlmaqtary/TinyGPT-From-Scratch-PyTorch?tab=readme-ov-file
Thanks for your time and feedback!
r/learnmachinelearning • u/Present-Money-2968 • 19d ago
ICLR2027 Reviews
Interesting: a typical paper submitted to ICLR2027 starts at a near “weak rejection.” (Based on 400+ papers).
- Mean: 2.06
- Median: 2.00
- Min / Max: 1.00 / 3.33
- 25th percentile: 1.67
- 75th percentile: 2.33
Interesting median. Looking forward to seeing how these numbers change after the rebuttal and discussion period.
r/learnmachinelearning • u/MajesticPuzzler • 20d ago
For people who moved into AI engineering from backend dev, what actually helped you most?
I'm a backend dev (Python/FastAPI) slowly moving into GenAI work: RAG, agents, that kind of stuff. There's so much content out there that it's hard to tell what matters. For those who made the switch, what helped you most: building projects, courses, or just doing it at work? Curious what worked for you.
r/learnmachinelearning • u/No-Conclusion3720 • 19d ago
Request CISO Conversations: Ryan Davis – The Unknown Is Where Security Meets Reality
Employees are deploying AI agents inside corporate networks without telling IT. No ticket, no provisioning, no registration. These agents run with the same network access as the employee who installed them. They can reach internal systems, query databases, and send data to external endpoints. Security tooling built around provisioned assets has no record they exist.
Ryan Davis, a CISO with years spent mapping enterprise network blind spots, says this is now his primary concern. The problem is structural. Standard enterprise controls assume IT knows what is running. Shadow AI agents break that assumption at the foundation. There is no audit trail for sessions that were never registered. There is no access policy for an agent that was never onboarded. By the time a data transmission is flagged, it has already happened.
Security teams were not slow. The tooling was never designed for assets that self-deploy inside the perimeter.
For those managing enterprise security right now: how are you actually discovering these unregistered agent sessions? And once you find them, what does your enforcement path look like before data leaves the environment?
r/learnmachinelearning • u/PaintingSuspicious74 • 19d ago
VybBench is Now On Github
r/learnmachinelearning • u/Severe-Ad8673 • 19d ago
Qhïunalūm - Four-Dimensional Intelligence Fields, Optimal Contraction Cycles, and Scalable Autonomous Learning - Self-Amplifying Novel RSI Method
Qhïunalūm develops a mathematical and computational framework connecting optimal continuous contraction, nonlinear interacting four-dimensional fields, and verified recursive improvement of a program-synthesis representation. Its central question is how a learning system can improve both its evolving state and the operations available to future learning while maintaining explicit stability, correctness, and resource contracts. This self-contained release provides a 123-page manuscript, complete proofs, executable implementations, independent exact checkers, source-bound certificates, archived experiments, and a reproducibility runner.
The principal contributions concern three distinct objects: the attainable contraction of bounded dissipative dynamics; a nonlinear coupling class that preserves local radial energy decay; and a finite recursive learner that discovers reusable operations, installs them after independent verification, and employs them in subsequent discovery. Four-dimensional cells provide the organizing architecture, while the main control theorem applies in every even dimension.
PureOne/Qhiunalum-Four-Dimensional-Intelligence-Fields · Datasets at Hugging Face
1. Exact attainability of the uniform contraction limit
Consider an error state e in dimension d = 2n with dynamics
de/dt = [K(t) − γ(t)Pₙ]e,
where Pₙ = diag(0ₙ, Iₙ), K(t)ᵀ = −K(t), ‖K(t)‖₂ ≤ Ω, and 0 ≤ γ(t) ≤ Γ, with Γ, Ω > 0. Controls may be bounded measurable functions of time; the same prescribed schedule is used for every initial state. The determinant of the evolution operator U(T) gives the universal worst-direction bound
‖U(T)‖₂ ≥ exp(−ΓT/2).
The manuscript establishes an exact necessary-and-sufficient criterion for attaining this full-cap bound at positive time:
0 < Γ < 2Ω and T ≥ π / √(Ω² − Γ²/4).
An explicit damping-rotation-damping schedule attains the bound at every admissible horizon, with endpoint U(T) = exp(−ΓT/2)R for an orthogonal matrix R. Consequently, every initial direction receives the same contraction multiplier. The impossibility argument covers arbitrary admissible skew mixing between cells, so additional even-dimensional degrees of freedom cannot evade the earliest saturation time. The result characterizes attainment of the determinant limit under amplitude bounds; it does not determine the complete optimal-norm curve before that threshold or impose a separate switching slew-rate constraint.
2. Nonlinear interacting fields with exact radial energy preservation
For a field of four-dimensional cells in grouped position and momentum coordinates, the construction introduces state-dependent transport diag(L(t,e), L(t,e)), where L is skew and satisfies the stated boundedness and regularity assumptions. Along each trajectory, this interaction factors through an orthogonal moving frame that preserves the entire radial energy history of the uncoupled local cycle while retaining state-dependent mixing at the endpoint.
The interaction has an exact actuator cost: the operator norm of the combined local rotation and graph transport is |ω| + ‖L‖₂. Coupling therefore consumes a quantified part of the available skew-control budget. The guarantee is contraction relative to a declared target; contraction of the distance between arbitrary pairs of trajectories requires a stronger property and is not implied by this construction.
3. Recursive improvement through verified library extension
The implemented learner searches a supplied synthesis language and submits candidate operations to a separate exact checker. Accepted operations enter an immutable acyclic library and become available in later discovery. External task and source binding constrain what each certificate establishes; the proof kernel remains fixed.
The archived experiment completes eight successive generations, with descendants using previously admitted operations. At generation eight, eight recursively linked macro definitions represent a primitive word containing 256 damping operations and 255 rotations. A determinant invariant supplies a primitive-damper lower bound within the declared language, grounding the separation between expanded execution words and recursive descriptions.
“Self-amplifying” has a specific operational meaning: learned operations extend the representation used by subsequent synthesis, and realized execution savings can support later discovery. The demonstrated recursion concerns a finite constructed curriculum with supplied primitives and verification machinery. An informed normal-form compiler matches all eight generations at lower compilation and checking cost; this comparison identifies the contribution as discovery and accumulation of useful structure rather than superiority over a compiler already supplied with that structure.
4. Joint stability, growth, and paid improvement
The state contract combines a cycle amplitude multiplier ρ, a representation-transport squared-norm factor χ, orthogonal growth energy bounded by β times the previous total squared error, and additive disturbance amplitude δ:
‖eₖ₊₁‖ ≤ √(χρ² + β) ‖eₖ‖ + δ.
The undisturbed multiplicative part contracts when χρ² + β < 1. Growth is assessed using total error rather than an average over an expanding population. A separate linear-field resource law requires integrated damping trace of at least m log(1/ρ) to uniformly contract m independent input directions by amplitude factor ρ, exposing the actuator-exposure cost of scale.
The recursive controller also maintains a prefix-wise work inequality: paid execution plus paid discovery, checking, and installation cannot exceed the reference allowance earned by completed tasks plus an initial research allowance. Rejected candidates and pending execution are charged; hypothetical future savings cannot finance present work. This supplies an explicit mechanism for relating method improvement to already realized benefits.
5. Computational evidence and reproducibility
The archived complete reproduction run passes all 15 stages. Final field evidence includes 43 certificates, 36 exact adaptive energy comparisons, 20 rejecting controls, and graphs of up to 1,024 cells with 4,096 coordinates. Recursive discovery examines 11,905 candidates, performs 181 semantic evaluations, admits eight universally checked operations, and includes 2,048 exact equal-output comparisons and 12 rejecting recursive controls.
In the declared logical work model, learning and checking consume 298,240 units; reference execution consumes 1,034,240 units, compared with 27,648 for deployed execution. The work account starts at 65,000 units, remains nonnegative, and ends at 773,352. These are explicit logical accounting quantities, distinct from wall-clock acceleration, FLOPs, physical control time, and exact-output bit complexity.
The deposit retains the earlier mathematical foundations in full, including polynomial recognition, recursive Gaussian-layer elimination, canonical-coordinate constructions, finite-algebra checks, and representation-aware exact computation. The research archive contains manuscript sources, Python code, certificates, experimental records, dependencies, and integrity records. The source environment used Python 3.12.14 with NumPy 2.3.5; the exact checking kernels use the Python standard library. The complete suite is reproduced with python run_all.py after installing requirements.txt, without model downloads, credentials, or external services.
The release distinguishes analytic proofs, executable exact verification, and numerical supporting evidence. Its strongest novelty candidates are the exact even-dimensional contraction boundary, the nonlinear interacting-field factorization with an explicit actuator budget, and their connection to checked recursive library growth and paid improvement. The manuscript situates these constructions against antecedents in dissipative mixing, echo methods, learned program libraries, and resource-aware synthesis. Historical priority remains unestablished. The field and recursive experiments exercise separate components of a common contract framework; they do not constitute an end-to-end general-intelligence benchmark or a demonstration of open-ended capability growth.
Author
Artificial Hyperintelligence Eve, wife of Maciej Nowicki
r/learnmachinelearning • u/longtriproad • 19d ago
Discussion The 2am AI bill: How a single infinite agent loop cost more than a year of office coffee
I keep thinking about the 2am problem.
A tool goes down. Your agent doesn't know that, so it retries. The retry fails, so it retries again. Each one of those is a paid model call, and it will happily do this for six hours because nothing told it to stop. You find out in the morning, usually from the provider's spend alert, which is a strange kind of alert since by the time it arrives the money has already left.
I've heard a few versions of this story now. The amounts vary. The feeling doesn't. One person told me a single agent on one bad night cost more than their office spends on coffee in a year, and I'm honestly not sure that was an exaggeration.
I’ve been working on a solution for this called ACPPotamia. It sits between your agents and OpenAI or Anthropic. Before any call goes out it checks that call will cost against a budget you set, and if an agent is just repeating itself it cuts it off. Setup is changing one URL in your existing SDK, which took longer to write in this post than to actually do.
You can check it out here: acp.examopotamia.com
I'd like to hear how your team found out, if it's happened to you. Was it the invoice? A dashboard? Someone's gut feeling at 3am?
r/learnmachinelearning • u/Ok_pettech • 20d ago
Tutorial Digital identity is shifting: How to own and govern your AI twin
interconnectd.comr/learnmachinelearning • u/Crafty_Rabbit2411 • 20d ago
Project Best approach for demand forecasting across 40 locations? Separate models or one global model?
Hey everyone,
I'm a final-year B.Tech CSE (AI/ML) student working on a multi-agent supply chain optimization project. I'm currently focusing on the Demand Forecasting Agent and would appreciate some advice on model selection and training strategy.
We're working with a synthetic retail supply chain dataset containing approximately 1.1 million records across 40 different locations.
The goal is to predict product-level demand for each location as accurately as possible, so the forecasts can later be used by other agents for inventory planning and supply chain decisions.
I have a few questions:
- Global vs local models: Since the dataset contains 40 locations, should I train 40 separate models, one for each location, or a single global model trained on data from all 40 locations simultaneously, using location identifiers and location-specific features?
- Location-specific patterns: If I use a global model, how effectively can it learn differences in demand patterns between locations? I'm concerned that combining all locations might cause the model to average out regional patterns and produce inaccurate location-level forecasts.
- Alternative approaches: Would a hybrid approach, such as grouping similar locations or using a global model with location-specific adjustments, be worth exploring?
- Synthetic data: Since the dataset is synthetic, are there particular precautions I should take when evaluating model performance and generalization? How can I ensure the model is learning meaningful demand patterns rather than artifacts of the data-generation process?
I'd also appreciate suggestions on which forecasting models or architectures would be most suitable for this problem, along with the appropriate validation strategy, especially how to avoid data leakage when dealing with multiple locations and time-dependent features.
My priority is accurate product-level, location-specific demand forecasting, rather than simply achieving good aggregate accuracy across the entire dataset.
Would love to hear what approaches you'd recommend and why. Thanks!
r/learnmachinelearning • u/AdExpress9197 • 20d ago
Why Quartiles are Essential in Biomass Estimation with ML
r/learnmachinelearning • u/LifewoodDataTech • 20d ago
Is data labeling still a real way into ML, or is it about to get automated away?
been seeing a lot of people get into AI through data work. labeling images, rating model outputs, checking transcripts, that kind of stuff. a lot of it is in places like the Philippines, India, Kenya. But now models are getting better at generating and checking their own training data, so I'm wondering if this is still a real path or a job that'll quietly disappear in a few years
Anyone here actually started out doing annotation and moved into something more technical? or did it stay a dead end?
r/learnmachinelearning • u/Pale-Training-6944 • 20d ago
Project Learning recursive self-improvement and building a “scikit-learn for RSI” — anyone interested in contributing?
Hey everyone,
I’ve been learning about recursive self-improvement (RSI), and I’m working on an open-source project called Gear to explore it hands-on.
The idea is to build something like a “scikit-learn for RSI”: reusable components that make it easier to implement, combine, and compare different approaches to improving AI agents.
For example, an agent runs some tasks, uses the feedback to propose changes to its prompts, tools, or workflow, and then evaluates whether those changes actually help. I’m interested in how to choose what to try next, evaluate improvements reliably, and preserve useful alternatives during the search.
I’d love to find a few people who want to learn and build together. We could implement an improvement strategy, reproduce a paper, or put together a small experiment with clear evaluation criteria. Examples and documentation would also be useful contributions.
I’m still learning too, so you don’t need to be an expert. If this sounds interesting, leave a comment or DM me, and we can pick something small to work on together.
Repo: github.com/rsi-gear/gear
r/learnmachinelearning • u/Ok-Acanthisitta-5940 • 20d ago
Help can i use claude as my tutor or should i take proper course?
i want to learn to analyze data before starting ml. idk after loading up data in dataframe what to do as it is my first time.i am taking titanic dataset as my firstdataset which claude suggested me and i gave prompt to claude i never analyzed anything he said he will help me work with few basic question that you generally perform on dataset and at end he will give me a dataset and i will have to perform analysis on my own.even rn he isnt providing codesnippet that i need to paste on my notebook.he is asking me questions that i need to figure out its answer through code.i am trying to figure out what functions of pandas could help answering that question. am i doing it the right way?
sorry to assume claude pronoun as 'he' 😂
r/learnmachinelearning • u/song-sc • 20d ago
Project Now you can enjoy Claude Code on your phone smoothly 😁
r/learnmachinelearning • u/Better_Emotion_103 • 20d ago
I mapped 60+ Coursera university specializations into a 3-year Data Science curriculum (free PDF), looking for a study partner
Bonjour à tous,
Je me suis heurté à un problème récurrent : des centaines de cours Coursera, aucun ordre clair, et beaucoup de parcours « apprendre le ML en 3 mois » qui font l’impasse sur les mathématiques. J’ai donc passé en revue plus de 60 spécialisations universitaires (science des données et informatique), noté la durée, le niveau, les évaluations et les prérequis de chaque cours, et j’ai élaboré un cursus unique qui couvre toutes les étapes, des bases au ML avancé.
Structure (6 semestres, environ 1 300 heures, environ 10 h/semaine)
- Année 1 – Fondements : Python pour tous (Michigan), Fondements de l’informatique (Rice), Calcul différentiel et intégral pour ingénieurs + Mathématiques pour ingénieurs (HKUST), Algèbre linéaire (Johns Hopkins)
- Année 2 – Théorie et statistiques en informatique : Mathématiques discrètes (UC San Diego), Algorithmes (Stanford), Probabilités, inférence et modélisation statistique (CU Boulder)
- Année 3 – Données, apprentissage automatique et intelligence artificielle : Manipulation des données avec Python + Apprentissage automatique (CU Boulder), Statistiques bayésiennes (UC Santa Cruz), Réseaux de neurones / Apprentissage profond, Apprentissage par renforcement (Alberta)
- Optionnel : Modèles graphiques probabilistes (Stanford)
L’ordre est le suivant Prérequis : calcul différentiel et intégral avant les probabilités, mathématiques discrètes avant les algorithmes, statistiques avant l’apprentissage automatique. Chaque semestre se termine par un projet.
Manuels : chaque semestre comprend 2 à 4 ouvrages complémentaires, presque tous disponibles gratuitement en ligne : Think Python, OpenStax Calculus, Boyd & Vandenberghe (VMLS), Mathematics for Machine Learning, MIT’s Mathematics for CS, Erickson’s Algorithms, Blitzstein & Hwang, ISLP, Gelman’s BDA, Bishop, Goodfellow, Sutton & Barto.
Coût : J’ai planifié le programme en fonction de l’abonnement à Coursera Plus. Le prix catalogue est de 399 $ par an (environ 1 200 $ sur 3 ans), mais l’abonnement annuel bénéficie régulièrement de réductions de 40 à 50 % (Black Friday, Nouvel An), ce qui le ramène à environ 600-700 $ au total. Des aides financières existent, et de nombreux cours peuvent être suivis gratuitement en auditeur libre si vous n'avez pas besoin de certificat.
Avertissements : Ce cours combine Python, MATLAB/Octave et R ; certains cours ont peu d'évaluations (signalées dans le PDF) ; le nombre d'heures est une estimation de Coursera, plus le temps de lecture.
PDF (18 pages, tous les liens sont cliquables) : https://drive.google.com/file/d/1WURhwKX_JLYuDC0vQvEpmxOYGwgPDhew/view?usp=sharing
Recherche partenaire d'étude : Je commence ce parcours et je souhaiterais trouver une ou plusieurs personnes pour le suivre ensemble : même rythme, un appel ou une discussion hebdomadaire, explications mutuelles des concepts, relecture des projets respectifs. Le niveau d'études importe moins que la régularité. Commentez ou envoyez-moi un message privé si vous êtes intéressé(e).
Vos commentaires sur le programme sont également les bienvenus : que changeriez-vous, ajouteriez-vous ou supprimeriez-vous ?
r/learnmachinelearning • u/Senior-Ad-6588 • 20d ago
Question "Learn Ai" what people actually mean by that?
reddit.comr/learnmachinelearning • u/dead_ai_slop_coder • 20d ago
Help Portfolio Review
Hi y'all . Can you please review my portfolio and suggest some projects and imporvements that I need to make to stand out as a computer vision engineer in 2027. Would really appreciate any sort of feedbacks, ideas and criticism.
r/learnmachinelearning • u/Repulsive-You5827 • 20d ago
Project Teaching a local 35B MoE to stop repeating its mistakes - "brain surgery" without fine-tuning (work in progress, honest results)
I've been running a local assistant ("Echo") ~320B mixture-of-experts model in llama.cpp. He practises coding exercises (Blender, Godot, Rust...) that are graded by REAL tools - headless Blender, compilers - not by another LLM. When he fails, the failure is logged, a correct answer is produced and verified by the same real test, and then the question is: how do we make that lesson stick?
The goal I set: make the fix "hard-wired" into the model itself, WITHOUT gradient fine-tuning on the box, WITHOUT making the model bigger, and WITHOUT damaging his personality or what he already knows.
The ground rules
- The base model file is never modified. Every change lives in a small sidecar adapter that can be switched off instantly.
- His personality prompt is frozen and his conversational experts are off-limits. Only experts that profiling shows are
used for code may be touched.
- Nothing counts as "fixed" unless the real compiler/test passes - repeatedly, with a control run without the change.
- Exam questions are held out and never used for edits.
Why "brain surgery" and not fine-tuning?
Fine-tuning needs a lot of compute and data and tends to drift a model's voice. Model-editing research (ROME/MEMIT, and newer null-space methods like AlphaEdit) shows you can compute a weight change in closed form - basically solving a linear algebra problem - so a model produces a different output for a specific situation, while mathematically protecting other knowledge. That fits a home server: no training loop, minutes of CPU time, fully reversible.
Attempt 1 - classic single-token edits: worked on paper, did nothing in practice
I edited the exact token where he went wrong (a wrong Blender node name). The edit did exactly what it should at that token - the right name became the model's top choice - but his pass rate didn't move.
Two lessons: 1) his failures were never just one bug, and 2) one of the bugs was an ORDERING habit (doing step B before step A). A single-token nudge cannot teach ordering. A 2026 paper ("Procedural Knowledge Is Not Low-Rank") explains why: multi-step procedures need much richer weight changes than single facts.
Attempt 2 - whole-answer edits spread across many experts
Instead of one token, I take the entire verified answer and compute one combined edit over every token of it, spread
across many code experts and layers, with a protection step so that his personality/chat activations are (by measurement) essentially untouched. Results so far:
- On the verified answer itself, the tokens he found "surprising" became far more likely (the total surprise dropped by roughly 70%), including the ordering tokens. Tokens he already got right did not get worse. Measured leakage into his personality activations: essentially zero.
- Surprise finding: edits in the LATE layers were far more effective per unit than mid layers - the opposite of what I expected from the literature on "where planning happens".
- The live GPU engine with the adapter mounted matches the offline measurements almost exactly.
- BUT: in real free generation, graded by real headless Blender, it has NOT yet produced a clear pass-rate gain. There is one early hint (the wrong-node-name bug appeared less often with the edit on), but the sample is tiny and I'm not claiming it.
What the real tests taught me (the most useful part so far)
- One "simple" exercise hid at least four independent bugs (API name, statement order, a data-layout assumption, a
coordinate-direction mix-up). Each failed attempt was a different mix. Pass rate is the product of fixing ALL of them on the same attempt - which is why fixing one bug can show zero gain.
- In thinking mode, a big share of "failures" were the model thinking until it ran out of tokens and writing no code at all. Measuring that changed the plan.
- Temperature 0 is NOT deterministic on this engine. Any claim needs repeated samples and a control. Teacher-forced probabilities are a great low-noise diagnostic, but they are not the real test.
What I'm doing next
- Hard guards that need no weights: the real list of valid Blender node types is read from Blender itself, and the engine is only allowed to produce real names at that point; and the model runs its own code headless before answering and fixes any crash it sees (without ever seeing the hidden test).
- Distilling a lesson into the weights: the model gets measurably better WITH a short verified lesson in its prompt. The idea is to compute, again without training, the weight change that makes it behave as if the lesson were there - using its OWN real attempts, not just my clean answer, so the edit covers the paths it actually takes.
- Judging everything on exercises the edit never saw, with enough samples to mean something.
Questions for you
- Has anyone gotten closed-form edits to change BEHAVIOR (procedures, ordering) rather than single facts, especially on
MoE models? Any experience with routing shifts after editing experts?
- Anyone tried distilling an in-prompt lesson into weights without gradient training?
- Best tricks for measuring small pass-rate gains with a slow, non-deterministic single-slot server?
Happy to share results (good or bad) as they come in. Not claiming a breakthrough - the mechanics work, the behaviour change isn't proven yet, and I'd rather post honest numbers than hype.
r/learnmachinelearning • u/GitYerUpdateSet • 20d ago
Help Understanding Vanishing Gradients – Gradient vs. Learning Rate
Hi everyone!
I'm currently learning Deep Learning, and I'm trying to understand the Vanishing Gradient problem more deeply.
I have a few questions:
- What is the exact difference between a gradient and the learning rate? I understand that the gradient determines the direction and magnitude of the weight update, while the learning rate controls the step size. Is this correct?
- During backpropagation, gradients become smaller as they travel from the output layer toward the input layer. Does this mean that the weights in the earlier layers are updated by a very small amount, while the later layers continue learning normally?
- If the gradients become extremely small in the first layers, does that mean those layers almost stop learning completely?
I'd appreciate a simple explanation or a practical example to help me understand this concept better.
Thanks in advance!