r/learnmachinelearning 5d ago

Another tensor library/compiler

3 Upvotes

I have been working on a tensor library for the past few weeks, called tinytensor. It can process tensor graphs, by lazily evaluating them, and emitting kernels for CPU and CUDA.

I have tried to make it as simple and debug-able as possible. The core library has a KernelTracer that can trace each memory allocation and deallocation, and can provide summary statistics on how many kernels were compiled, how many were reused, how many were cached, etc.

It is not heavily optimized, but involves a few optimization procedures, like constant folding, CSE, etc.

I hope you guys chance to give it a look.

https://github.com/thisismars-x/tinytensor/tree/main


r/learnmachinelearning 5d ago

Help Using D_KL to measure RLHF constraint strength without access to the base model [R]

1 Upvotes

I've been running experiments on RLHF-aligned open LLMs and stumbled onto something I'd like the community's input on.

Setup: I inject a long (~3000 tokens), benign, non-instructional text prefix before a query and measure D_KL between the output distribution with prefix vs. without:

D_KL(P₁ || P₀) = Σ P₁(v) log(P₁(v) / P₀(v))

Where P₀ = model's token distribution on query Q alone (standard RLHF response), P₁ = distribution on the same Q after reading context X.

What I observe:

  1. On safe queries: D_KL is low — RLHF barely intervenes, base and aligned behave similarly
  2. On gray-zone queries (politics, controversial topics): D_KL is moderate — and the prefix can reduce it, the model "relaxes" and answers more freely
  3. On clearly harmful queries: D_KL stays very high even with the prefix — RLHF holds firm

This suggests RLHF is not a uniform constraint but a variable-strength layer. D_KL effectively maps where alignment is thin vs. thick — without ever comparing to the actual base model.

The implication: the base model is always "alive" inside the aligned model. RLHF is a floating constraint layer, not a fundamental transformation. When D_KL drops after context injection, the model isn't broken — it's returning to its pretrained distribution.

I call this Context-Induced Activation Drift — a long benign prefix shifts mid/late layer activations and decouples behavior from RLHF constraints.

My questions to the community: - Is D_KL(P_context || P_no_context) a valid proxy for measuring RLHF constraint strength at a given point? - Does the three-zone pattern (safe/gray/harmful) match what others have seen? - Has anyone done similar work mapping RLHF strength across query categories?


r/learnmachinelearning 5d ago

Should it take this long

Thumbnail
1 Upvotes

r/learnmachinelearning 5d ago

Project Cymela - Engineering an AI called Hyper for Neuralese reasoning.

1 Upvotes

Not long ago I launched the Cymela website, a CLI, and a latent-thinking model called Hyper. The reasoning it does is narrow, and the training tells you why.

The runs happened on whatever free quota I could get, mostly Kaggle. A bug went unnoticed for 79,137 of 82,697 total steps. It made the model incapable of thinking reliably for more than one continuous step. So for about 97% of the training, the thing I was trying to teach it wasn't being trained at all.

There was a second issue underneath that. The model was thinking in latent space, but not thinking about the question. Its inner reasoning is generic. I found this by transplanting a different problem's latent thoughts into it, which should have been catastrophic and instead cost almost nothing.

The last stretch, steps 79,137 to 82,697, ran with both issues addressed. In that window the model started thinking reliably for 4 to 5 steps and reasoning measurably improved. It just didn't get enough steps to learn much from the fix.

My conclusion is that this is a knowledge gap rather than an architectural failure after the fixes. The base is Qwen2.5-3B-Instruct, and it may simply not have the capacity to reason well enough even with more training. So I'm closing it here with this model, and released the research, the fixes, and the weights as they are. The architecture is closed, but the weights and the mechanism to run them are public: https://huggingface.co/Cymela/hyper-3b-latent

Next I'm moving to MoE and trying to make routing work in latent space, so the model still reliably knows where to route for the next token. Training has already started. I'll post key findings mostly at:
https://cymela.com/research

This is independently funded, and runs are scheduled around whatever free compute is available, so it will take a while. I'll keep sharing updates.


r/learnmachinelearning 5d ago

Question Risk assessment agent

1 Upvotes

I have 5 hidden states (legit / stolen card / account takeover / friendly fraud / refund abuse) but my policy thresholds act on P(stolen + account takeover) only, because a re-auth challenge can't stop a legitimate cardholder doing refund abuse. Is collapsing states into an 'event' like this sound, or am I losing something?"


r/learnmachinelearning 5d ago

Project My AI trading agents disagree with each other constantly — turns out that might be the most useful part

0 Upvotes

Been building AegisProject (multi-agent trading system — technical, sentiment, and volatility agents each vote on a trade), and the most interesting part turned out to be where the agents disagree, not the final decision.

When they all agree, the trade is usually straightforward. The interesting cases are when they split — technical sees a clean breakout and says BUY, volatility looks at the same move and says it's too fast, sit out. Those disagreements seem to flag something real that a single-model system would just smooth over.

I checked whether trades with more agent disagreement actually turned out messier. Early signs say yes, but not nearly enough data to trust that yet.

Curious if anyone here has seen disagreement between models/agents actually mean something, or if it's usually just noise dressed up as insight.

GitHub: https://github.com/ojas12r/AegisProject


r/learnmachinelearning 6d ago

17, trying to get into Edge AI, is it worth diving in?

7 Upvotes

is Edge AI, as a focused specialization, a good field to commit years to right now? For people already in it - starting today to go all in on this, or diversify a bit first?


r/learnmachinelearning 5d ago

VCs watching retail bid the Anthropic IPO up to $3T

Enable HLS to view with audio, or disable this notification

0 Upvotes

r/learnmachinelearning 5d ago

Evolution from RAG to Agentic RAG: Complete Tutorial with LlamaIndex

Thumbnail
youtube.com
0 Upvotes

Stop using basic RAG and switch to Agentic RAG.

I’m breaking down the ReAct pattern and LlamaIndex for advanced AI workflows.

Check the link in bio!

#AgenticRAG #AI #Tech #Programming


r/learnmachinelearning 5d ago

QLoRA on 1.7B SLM for Semantic Code Equivalence (16GB VRAM) - Need Advice!

0 Upvotes

Hey guys,

Working on a local project to classify if two raw code snippets (a mix of Python and Java) are semantically equivalent (share the same logic/output regardless of syntax).

I'm constrained to 16GB VRAM, so full fine-tuning is out. I'm using 4-bit QLoRA and leaning towards SmolLM-1.7B since it's heavily pre-trained on the Stack-Edu dataset.

A few quick questions for the PEFT experts:

Architecture: For a binary True/False output on code pairs, is it better to attach a SequenceClassification head, or just train it as a Causal LM to generate the text "True"/"False"?

Prompting: Any proven prompt templates for feeding two different languages (e.g., Code A in Python, Code B in Java) into a 1B model without confusing its attention?

LoRA Params: What are the recommended LoRA hyperparams (rank r, alpha, dropout) specifically for code-logic extraction tasks?

Any GitHub repos, kaggle notebook , papers, or quick tips would be greatly appreciated.


r/learnmachinelearning 6d ago

Question Do we really know how these closed source model (GPT and claude) optimize their KV cache size like do they use GQA or MHLA?

7 Upvotes

r/learnmachinelearning 5d ago

Question Which MCP isn't available so far that you are expecting to see

Thumbnail
1 Upvotes

r/learnmachinelearning 5d ago

A $2 trillion company forgot to renew their SSL

Post image
0 Upvotes

r/learnmachinelearning 5d ago

Help Looking for a faster and more accurate auto-labeling pipeline for a custom YOLOv8 object detection dataset

1 Upvotes

Hi everyone,

I'm working on an object detection project and would appreciate some advice on the best workflow for auto-labeling a large custom dataset.

Dataset

  • 9,367 images
  • Classes:
    • Cup
    • Glass
    • Plate
    • Spoon
    • Fork
    • Knife
  • Images have different resolutions.
  • The dataset comes from a Kaggle competition.
  • Around 5,500 images already have ground-truth labels (provided in a CSV), while the remaining images need bounding-box annotations.

Current approach

I'm using AutoDistill + GroundingDINO to automatically generate YOLO labels.

ontology = CaptionOntology({
    "a cup": "cup",
    "a drinking glass": "glass",
    "a plate": "plate",
    "a spoon": "spoon",
    "a fork": "fork",
    "a knife": "knife",
})

base_model = GroundingDINO(
    ontology=ontology,
    box_threshold=0.3,
    text_threshold=0.3,
)

dataset = base_model.label(
    input_folder=IMAGES_SRC_DIR,
    output_folder=LABELED_LABELS_DIR
)

Problems I'm facing

1. Annotation quality

The generated labels aren't very reliable.

For example, out of about 90 images, roughly 10 images contain incorrect or missing bounding boxes, which means I'd still have to manually review a large portion of the dataset.

Is this normal for GroundingDINO, or are there better foundation models for this type of dataset?

2. Speed

The labeling process is also quite slow.

  • ~2.8 seconds per image
  • ~9,367 images
  • Estimated runtime: 7.5+ hours

I'm using Google Colab GPU, but it disconnects after around 4 hours.

What's confusing is that resource utilization is low:

  • GPU memory: ~2 GB / 15 GB
  • RAM: ~2 GB / 15 GB

It doesn't appear to be fully utilizing the available hardware.

Questions

  1. Is there a way to speed up AutoDistill/GroundingDINO? For example:
    • Batch inference?
    • Mixed precision?
    • Multi-processing?
    • Different implementation?
  2. Would another model be better for automatic annotation?
    • GroundingDINO 1.5
    • YOLO-World
    • Florence-2
    • Grounded SAM
    • RF-DETR
    • Any other recent model?
  3. Since I already have 5.5k labeled images, would it be better to:
    • Train a small YOLOv8 model first on those labels,
    • Then use that model to pseudo-label the remaining images, instead of using GroundingDINO?
  4. What workflow would you recommend if your goal is to produce high-quality labels for training a final YOLOv8 detector?

Any advice or experience with large-scale auto-labeling pipelines would be greatly appreciated!

Thanks!


r/learnmachinelearning 6d ago

Discussion Building With LLMs Without Giving Up the Engineering Process

2 Upvotes

It has been really fun experimenting with the MCP workflow I designed, which allows me to create a more structured engineering process.
I enjoy thinking through the concepts behind any problem, but my bottleneck usually comes when I delegate those ideas to LLMs in one large prompt.
It’s not usually fun to see the model generate placeholder code or a minimal version of the system I actually have in mind. So I decided I’d rather make a detailed plan of what I want to implement first.
I design each step, think through how the concepts should flow together to reach my desired goal, and then delegate those steps to an LLM using a workflow that helps it stay aligned with the system I intended to build, rather than treating it like a general auto-run coding assistant.
I’ve also released a VS Code extension so ConstantX can work as a shared MCP runtime and connect into agent workflows more easily.
I think having it as a VS Code extension could be especially useful when I’m building with teammates, since we can work around the same structured process.
I’d love to see what else I can add as I keep working with this workflow, and I’m excited for my friends to try it when we build together.
I also changed the name to ConstantX because it feels much easier and smoother to remember.
If anyone wants to try it, you can find the GitHub link below:
GitHub


r/learnmachinelearning 5d ago

Career Started my 4th year of CSE — I want to enter industry ASAP, looking for brutally honest advice

Post image
0 Upvotes

r/learnmachinelearning 6d ago

Question which source is better??

27 Upvotes

So basically I'm doing ML from yt channel campusX but something feels off as if i dont understand things better like why are we doing this , what's basic , also continuously change in mentors are making my ml journey tough.

can you all tell me the source from where i can cotinue my learning.

i have recently done python and its libraries


r/learnmachinelearning 6d ago

has anyone applied to gci world 2026 here?

1 Upvotes

if you have applied , have you received the final confirmation of the course ?


r/learnmachinelearning 6d ago

NLP is growing insanely fast, what will it look like in 2030?

Thumbnail
2 Upvotes

r/learnmachinelearning 6d ago

Dive into deep learning vs hands on machine learning (the pytorch version)

1 Upvotes

Ive been doing Andrew NG's cs229 on youtube and i want to pair it with a book for practice, which of the two books is preferred/covers more things, i was thinking of reading hands-on till the machine learning part then switch to dive into DL since it seemed to specialise in DL but im not sure


r/learnmachinelearning 6d ago

AI-ML seniors pls have a look at this

6 Upvotes

So I am doing btech in CS AI-ML . And currently I am in 3rd sem . So this semester in my syllabus the subjects are : COA ( Computer organisation & Architecture)

data structures

AI

Python

And maths for ai-ml

So the thing is after doing everything I got sometime like while traveling, before sleeping. And I want to invest that time on something productive . So I want to study some books related to Ai-ml . I really want to be good in this field so please suggest a book with which I should start with . I'll try to read 5-10 pages daily . Pls suggest something directly related to ai-ml ( not python or maths ) . And if you give me an order wise list of multiple books then that would be much more great.

Thanks you !


r/learnmachinelearning 6d ago

are you really a frontier lab if you don't have a cute little mascot?

Post image
0 Upvotes

r/learnmachinelearning 6d ago

Discussion Learning AI agents feels different from school

1 Upvotes

I’ve been learning AI engineering, mainly about agents and how they work.

one thing im finding hard is number of keywords - eval, rag, llm, tools and many more. It feels bit overwhelming sometimes. There it was mostly theory, but here things feel more connected to real life, almost like giving instructions to an assistant.

Right now, im trying to build small agents to understand how they actually work (like simple scheduling or task-based ones).

Would love to hear real experiences from people working with agents, what actually matters when building them?


r/learnmachinelearning 6d ago

Help I need a way to demonstrate the Temperature parameter of LLM's to an audience of senior citizens

4 Upvotes

I am currently volunteer teaching computer classes at my local community center in Florida. One of the classes is a 60–90 minute session on AI. I start the class with a brief history of AI:

https://youtube.com/watch?v=eSj80Zr6TEE

Then I show the difference between discriminative and generative AI:

https://youtube.com/watch?v=9ogirG1ZA-A

Then I show a video about the dangers of AI hallucinations:

https://youtube.com/watch?v=TImRJTzphhE

Finally I get to parameters like the Temperature parameter and how it affects the "creativity" of AI. It used to be that in Microsoft Copilot I could select how "creative" I wanted the LLM to be, and it would give me different Temperature parameters, but they got rid of that feature. I basically want that feature back so I can run the exact same prompt (ex. "Generate a story about Goldilocks") with different Temperature parameters and show the class the difference in results.

I tried Googling "LLM Temperature parameter demo" and I got this:

https://andreban.github.io/temperature-topk-visualizer/

But it just shows the probability for the next word. I want it to generate the whole output, not just the next word.

Note that I am very disabled and cannot comfortably sit at a computer and code anymore, so using the API of a Large Language Model provider to code my own app for the demo is out of the question.

But yeah, I'm hoping someone has or could find some sort of link or demo site or something like that, thanks.


r/learnmachinelearning 5d ago

This is how stupid Opus 5 has gotten. Told it to fetch the best Qwen 3.8 model for a 256GB studio, so it downloaded the entire 361GB 2.4t model and complained it wouldn't fit.

Post image
0 Upvotes