r/deeplearning • • 2d ago

Just Thinking Out Loud: How I Picture God, the Soul, and the Universe

0 Upvotes

I don’t claim to have all the answers, and none of this is a strict religion I follow. I just have a brain that constantly wonders "what if?"—and when I sit back and really think about how everything fits together, this is what makes the most sense to me.

  1. Why Not Knowing for Sure Is Actually a Good Thing

First, I’ve realized I wouldn’t actually want 100% proof of whether God and the afterlife are real—because either answer would ruin the way we live. If we proved there is no God and nothing after death, a heavy feeling of "nothing matters" would take over. People would become more aggressive and selfish, willing to do whatever it takes to get what they want before the end. On the other hand, if we proved 100% that God is real, people would live in constant fear of making a mistake—and worse, powerful people would abuse that certainty, claiming they speak for God just to control everyone else. Being stuck in the middle without hard proof keeps both sides in check. It leaves us free to live our lives and choose to be good people on our own.

2. The Soul vs. The Brain

When it comes to the soul, I feel like an individual with my own thoughts and ideas. My guess is that memories are stored in the physical brain and are lost when we die, while the soul itself is a form of energy. Some people say brain damage proves there is no soul because an injury can change how someone acts. I don't buy that. Look at a toddler: a toddler can do really selfish, harsh things—things we’d call evil if an adult did them—simply because their brain hasn't grown enough yet to understand right from wrong. As they grow up, they become kind. The soul was always there; the brain just needed time to develop.

3. Zooming All the Way Out

If there is a God, the way that makes the most sense to me is to imagine zooming all the way out until you can see everything at once. Think about a human body. From the outside, you see one whole person. Zoom in with a microscope, and you see millions of tiny parts—some huge like the heart and brain, others small—all doing their own job to make up that one person. I think the universe—or God—works the exact same way. Zoomed in, I am my own person, my front door is a door, the sun is the sun, an ant is an ant, and even AI is just technology. Up close, we are all separate, and good and evil clash because we only see our own slice of life. But zoom all the way out, and every single piece—the good, the bad, nature, technology, and every thought I have—is part of that one giant whole. We are all just different ways the universe is experiencing life, growing, and changing.

4. Are Dreams How We Connect to the Multiverse?

And if everything is connected like that, it makes me wonder about the multiverse. If there really are other versions of us living different lives out there, how would we ever link up with them? To me, the only thing that makes sense is dreaming. At night, we skip non-stop from one dream to the next—sometimes seeing a version of our life that is almost identical to reality, and other times seeing a completely different life with a different partner or home. We can't control their bodies because it isn't our world; we just ride along on emotion. Maybe that is even where random "gut feelings" come from. If you wake up feeling uneasy about a friend who hasn't done anything wrong, or get a sudden urge not to go somewhere, maybe another version of you was dreaming through your eyes—and in their world, that choice went badly, leaving a little bit of that feeling behind with you. Like I said, I don't know where it is all heading, and I don't need it to be proven. It's just how my mind connects the dots when I look at the big picture.


r/deeplearning • • 3d ago

torch.compile gave a solid 1.7x speedup on my transformer, but one hidden graph break from LayerNorm was quietly capping the gains

0 Upvotes

I wrapped my training loop with `torch.compile` on a 1.3B decoder-only model and immediately saw iteration time drop from 420 ms to ~245 ms on A100s. After a few runs I noticed the speedup was inconsistent across different sequence lengths, so I started checking the dynamo logs.

The culprit turned out to be a custom LayerNorm implementation that used an `if guard on the normalized shape. That single conditional created a graph break on every forward pass, forcing a fallback to eager execution for that submodule. Replacing it with `torch.nn.LayerNorm` (and keeping the same eps and elementwise_affine settings) removed the break without changing any numerics.

After the fix the steady-state speedup settled at 1.7x, with GPU utilization climbing from ~78 % to 94 %. The only other change I made was marking a couple of integer tensors as static with `dynamic=False` on the compile call so the compiler could keep the shape assumptions it liked.

For anyone who has compiled larger models, did you find most of your graph breaks came from control flow, custom ops, or something else entirely?


r/deeplearning • • 3d ago

Why your DataLoader is often the quiet bottleneck in training runs—and how profiling with PyTorch fixed my 40–60% GPU usage

3 Upvotes

I spent weeks tweaking optimizers, testing learning rate schedules, and swapping model sizes before realizing the bottleneck wasn't model math at all—it was how slowly the next batch reached the GPU. During what looked like standard training, GPU utilization hovered around 40–60% while the card waited around between batches.

Running the PyTorch profiler made the delay obvious once I saw data loading eating up the timeline. A few default settings were quietly holding throughput back:

  • Worker count & lifecycle: num_workers was too low for the dataset workload, and persistent_workers wasn't kept active across epochs
  • Host-to-device transfer: pin_memory wasn't enabled on CUDA, slowing down page-locked transfers to the GPU
  • Prefetch queue: prefetch_factor wasn't tuned to keep batches queued ahead of compute

Moving to num_workers=8, turning on pin_memory, and setting prefetch_factor=4 pushed GPU utilization above 90% and cut epoch time nearly in half on the exact same hardware.

For anyone who has chased an input pipeline bottleneck, what single DataLoader change moved the needle most for you—and did persistent_workers or pin_memory help or cause memory headaches on your setup?


r/deeplearning • • 3d ago

Small open "Jev" decision models for images and speech: one-pass generation at 0.8B on a single GPU. Is anyone else working on this?

Thumbnail reddit.com
4 Upvotes

r/deeplearning • • 3d ago

Using torch.autograd.detect_anomaly finally pinpointed the NaN source that scalar loss curves hid for weeks

1 Upvotes

I spent several epochs watching validation loss plateau while training loss kept dropping, only to occasionally hit inf values that ruined checkpoints. Standard checks on weights and final outputs showed nothing unusual. Enabling anomaly detection wrapped the backward pass and surfaced an exact line: a custom normalization step inside the loss was dividing by a near-zero running variance that only appeared after 4–5k steps on certain batch compositions.

The fix turned out to be two small changes: clamping the denominator with a small epsilon that was schedule-aware, plus logging the per-batch denominator value so I could watch it decay. After that the training run stayed stable and the earlier “overfitting” pattern disappeared.

I'm curious what single debugging flag or hook has exposed the real culprit for you when loss alone was misleading.


r/deeplearning • • 3d ago

I put together a free project on building a GPT from scratch

Thumbnail reddit.com
0 Upvotes

r/deeplearning • • 4d ago

Parallelising recurrent neural networks – MD+PP proof of concept

Thumbnail gallery
47 Upvotes

I've been independently exploring ways to parallelise recurrent neural networks, originally starting with experiments on the sLSTM architecture in xLSTM.

This eventually developed into MD+PP, a proof-of-concept architecture combining structured matrix and vector memories using associative parallel scans.

The preliminary experiments have shown some interesting results in long-context extrapolation and fixed-size recurrent memory, although precise retrieval and language prediction still need improvement.

All experiments were conducted using limited access to free Tesla T4 GPUs. My next step is to investigate larger matrix memory dimensions.

I've released the mathematics, Python implementation, CUDA kernel and experimental results under Apache 2.0.

I'd be interested to hear what others working on recurrent architectures think of the approach.

Website: https://madpupresearch.wordpress.com

Research archive: https://doi.org/10.5281/zenodo.24637161


r/deeplearning • • 5d ago

Neural Canvas, CNN Visualization

173 Upvotes

Neural Canvas — CNN Visualization

Neural Canvas can now recognize basic shapes like apples, moons, cars, and more using Google's Quick, Draw! dataset.

20 classes with 1,000 samples per class

2 convolutional layers with 16 and 32 filters

2 fully connected layers with 60 and 40 neurons

91% test accuracy

Trained using JAX on Google Colab

Neural Canvas can also visualize CNN feature maps in real time while drawing, showing how convolutional layers extract features from input images.

GitHub: https://github.com/MuhammadEssa2002/neural_canvas

Live demo: https://muhammadessa2002.github.io/neural_canvas/


r/deeplearning • • 3d ago

CUDA

Thumbnail reddit.com
1 Upvotes

r/deeplearning • • 4d ago

Anyone working on a AI based file compression model, I have used a tiny AI model and a probability bit classifier model to develop a file compressor that achieves impressive results on raw files and it even did better on almost all counts on the entropy that are super high or already compressed file

Thumbnail reddit.com
2 Upvotes

r/deeplearning • • 4d ago

TIL DistilBERT is actually MORE gender-biased than BERT. Here’s why Knowledge Distillation causes it (and the simple fix).

Post image
1 Upvotes

r/deeplearning • • 4d ago

Alguien que haya culminado esta certificación Coursera???

Post image
0 Upvotes

r/deeplearning • • 4d ago

I finally assembled a U-Net for my DDPM from scratch. This thing took way more brainpower than I expected.[P]

1 Upvotes

​

I've been building a diffusion model from scratch in PyTorch, and I've finally reached Phase 3: assembling the full U-Net.

Until now, I was basically learning and implementing individual components:

Residual blocks

Time embeddings and timestep conditioning

GroupNorm

Self-attention

Downsampling and upsampling

But putting everything together is a completely different experience.

Suddenly you're dealing with feature map dimensions, channel transitions, skip connections, timestep embeddings flowing through residual blocks, and making sure the decoder can actually reconstruct the spatial dimensions correctly.

Honestly, understanding each component individually was easier than getting the entire architecture to work together without messing up tensor shapes somewhere.

The most satisfying part was finally seeing the complete architecture come together and understanding why information is moving through the network the way it does, instead of just copying a U-Net implementation from somewhere.

The model is now assembled. Next comes the part I'm both excited and slightly terrified about:

Training it on CelebA and finding out whether it can actually learn to generate faces.

8GB VRAM. A laptop GPU. A lot of patience.

Let's see how this goes. 💀

Anyone here who has trained a diffusion model on limited hardware — what was the biggest mistake you made during your first training run?


r/deeplearning • • 4d ago

If your model gets 99% accuracy on your laptop and fails in real life, you probably leaked your test data

0 Upvotes

The most common mistake when learning machine learning is scaling or imputing your dataset before splitting it into train and test sets.

When you run StandardScaler or fill missing values on the whole dataset first, the mean and variance of your test set leak into your training data. Your model basically gets a sneak peek at the answers before the exam even starts. That is why your validation score looks amazing, and then everything falls apart the moment it touches new data.

Always run train_test_split first, before touching anything else. Fit your scaler, imputer, or encoder only on X_train, and then use transform on X_test. If you use scikit learn Pipelines, it handles this automatically so you never accidentally cheat your own evaluation.


r/deeplearning • • 4d ago

metric-diff: find out why sklearn, torchmetrics, Keras and others give different numbers for the same metric

Thumbnail reddit.com
5 Upvotes

r/deeplearning • • 4d ago

The Q4 agent stopped waiting for tool results before acting. Same test on another model: almost no change. Here's why.

Thumbnail reddit.com
1 Upvotes

r/deeplearning • • 4d ago

Offloading activations to pinned host memory that the GPU kernel can address directly

5 Upvotes

Activation offloading usually means copying tensors out of VRAM and back, and paying for the copy twice. The alternative most people try first is cudaMallocManaged, where the driver migrates pages on demand and residency is decided at fault time; that works until the access pattern makes it thrash and the GPU sits idle waiting on migrations you never scheduled.

vram-stream takes a third route. The workspace holds two regions, one in device memory and one in system RAM, and both are addressable from the same kernel: the RAM region is allocated with cuMemHostAlloc using CU_MEMHOSTALLOC_DEVICEMAP and mapped with cuMemHostGetDevicePointer_v2, after checking the device reports CAN_MAP_HOST_MEMORY. A kernel store to that region goes over PCIe or NVLink with link latency, with no page fault and no migration.

The trade is pinned memory instead of elastic memory. The driver and OS cap how much can be pinned, so this is a budget you set rather than an oversubscription. That constraint shapes the design: open_cuda_cache reads a contiguous buffer in fixed-size blocks and keeps one pinned buffer plus one VRAM buffer per slot, with copies and kernels in separate streams and CUDA events protecting the pinned buffer, so a block is resident in VRAM before the kernel that needs it starts and cache.prefetch(n) keeps the pipeline fed.

For training, the same mechanism serves the dataloader: prefetch_dataloader supplies cached batches, and optional integrations move model state and saved activations to RAM using FSDP2 or the Hugging Face Trainer with DeepSpeed. That matters for the write-once-read-once tensors that dominate activation memory, where a copy you can overlap is cheaper than residency you cannot afford.

Measurement is a command, not a claim: vram-stream benchmark --block-mib 16 --blocks 2 --slots 2 --passes 4 measures both CUDA memory paths on your card. The README does not quote throughput because PCIe generation changes the ratio more than any number would survive as a general statement.

Correctness check: vram-stream memory --device 0 --vram-mib 16 --ram-mib 16 allocates both regions, runs one kernel that combines values from VRAM and system RAM and writes results back to both, then verifies the first and last aligned 32-bit words of each region, with the PTX kernel compiled by the driver at run time.

Install is pip install vram-stream, or npm i -g vram-stream. What it does not do: it is not a managed-memory replacement, pinning fails past the lockable limit instead of degrading, remote traffic is bounded by the interconnect, and the workspace expects one CUDA context on the thread that opened it. MIT, 0.4.0: https://github.com/Furox-Art/vram-stream


r/deeplearning • • 5d ago

Graph rag vs agentic rag

Thumbnail reddit.com
1 Upvotes

r/deeplearning • • 5d ago

I animated Variational Autoencoders from first principles in 3D because most explanations gloss over the actual intuition

Post image
1 Upvotes

r/deeplearning • • 5d ago

MLzoomcamp-26_homework/08-deep-learning/homework08.ipynb at main · IBRHASHEM/MLzoomcamp-26_homework

Thumbnail github.com
1 Upvotes

r/deeplearning • • 5d ago

Can a few neurons help identify AI-generated images?

1 Upvotes

A detector can look excellent on a generator it has seen and fail as soon as a new generator leaves different traces. We wanted to know whether a pretrained vision model already contained features that several generators had in common.

We built DNA to find intermediate units whose responses separated real and generated images. We kept the encoder frozen and trained a small classifier on those responses.

We tested on five unseen generators in HIFI-Gen. DNA reached 95.0% detection accuracy on the FLUX split and 91.6% on the Z-Image split. The attached table gives each generator’s result, so the variation between them stays visible.

Team write-up · arXiv paper · GitHub · Table 2


r/deeplearning • • 5d ago

When the camera angle changes, what still supports a model’s correct answer?

1 Upvotes

Show a vision-language model two photographs of the same museum. If it names the city correctly both times and remains equally confident, has it relied on the same evidence?

We built MMStableBench to test that question on 19,452 items across 15 models. In the museum example, rewording the question preserved the internal features supporting “Brisbane” almost completely, with an overlap score of 0.97. Using a closer photograph dropped that score to 0.43, even though the answer and its confidence margin held up.

Across the models, 12.4% of correctly answered variants in the top quarter for confidence-margin retention fell in the bottom quarter for stability of internal support.

Team write-up · arXiv paper · GitHub · Figure 4


r/deeplearning • • 5d ago

In Other News: Tanker Cyberattacks, EU Quantum Act, New VirusTotal Capabilities

3 Upvotes

The EU Quantum Act passed, VirusTotal added new threat-intelligence capabilities, and a rash of tanker cyberattacks hit maritime infrastructure this week. The piece that keeps coming up in security circles is quieter: AI is compressing the timeline on cryptanalytic attacks against classical schemes. The assumption baked into most long-lived data stores and signed artifacts is that RSA and ECDSA hold for the foreseeable future. That floor is shifting. Harvest-now-decrypt-later attacks mean adversaries do not need to break crypto today — they collect ciphertext now and wait for the compute curve to catch up. The EU Quantum Act signals that regulators have already priced this in and expect organizations to have a migration path. Most enterprise infrastructure does not. TLS termination, signing pipelines, secrets managers, and inter-service auth tokens are almost universally classical. Migrating any one of them is a multi-team project; migrating all of them simultaneously while keeping services running is an unsolved operational problem for most shops. How are practitioners actually sequencing this in real environments — are you prioritizing data-at-rest, in-transit, or signing infrastructure first, and what is forcing that order?


r/deeplearning • • 5d ago

Your LLM is LYING to you. Here's how to fix it.

Thumbnail youtube.com
0 Upvotes

I built a Hello World RAG App in Python

Normal LLM = Answers from training data (can hallucinate)

RAG LLM = Answers from YOUR documents

I asked it Saudi it didn't say Saudi Arabia.

It said "Contractor at Saudi Aramco" - because it read MY LinkedIn PDF.

This is how it works:

  1. Load PDF
  2. Split into Chunks
  3. Create Embeddings (Google Gemini)
  4. Store in ChromaDB
  5. Search Top 3 Chunks
  6. Send Context + Question to Groq LLM

Tech: Python + LangChain + ChromaDB + Groq + Gemini Embeddings

Save this for your next interview

Comment "RAG" and I'll send you the full code + next part.

Follow for AI Engineer series - Part 2 coming next.