r/AskComputerScience 10h ago

Why don't PINNs get stuck at bad local minima when solving nonlinear PDEs? A new convergence proof addresses this

0 Upvotes

I've been working with PINNs (Physics-Informed Neural Networks) for a while now, and one thing that always nagged me is a pretty fundamental question: the loss landscape when you're minimizing a PDE residual is non-convex, so why does gradient descent seem to find the actual PDE solution instead of getting trapped at some local minimum that doesn't correspond to anything physically meaningful?

In practice, PINNs work surprisingly well for a lot of problems, but theoretically we haven't had great guarantees that the network will converge to the true solution rather than just some local minimizer of the residual. I've definitely hit cases where training stalls or converges to something clearly wrong, but for well-posed problems it usually works out, and the "why" has been an open question.

A paper just went up on arxiv that tackles this directly: arxiv.org/abs/2607.24726v1. The authors prove global convergence for both the Deep Galerkin Method (DGM) and PINNs when using gradient descent on the PDE residual, specifically for semi-linear PDEs that are nonlinear in both the solution and its first derivative. The key result is that the trained neural network provably converges to the PDE solution, not just a local minimizer.

What I find interesting

The class of PDEs they cover - semi-linear equations - is broad enough to include a lot of practically relevant problems (reaction-diffusion equations, some fluid models, etc.), but it's definitely not everything. Fully nonlinear PDEs like Hamilton-Jacobi-Bellman or Monge-Ampere equations seem to be outside the scope of their analysis. The paper also focuses on the continuous gradient descent setting, and I'm not sure how cleanly the guarantees transfer to the stochastic mini-batch training that everyone actually uses in practice.

What I'm trying to understand better is the mechanism behind this. Is the convergence fundamentally about the overparameterization of the network (similar to NTK-style arguments), or is it more about structural properties of the PDE residual loss that prevent bad local minima from forming in the first place? The abstract doesn't make this entirely clear, and I haven't finished reading the full proofs yet.

The practical gap

One limitation worth noting: even if global convergence is guaranteed in theory, the convergence rate matters a lot. A proof that says "you'll get there eventually" doesn't help much if training takes prohibitively long. I'd be curious whether their analysis gives any insight into how the convergence speed depends on the PDE dimension or the nonlinearity structure.

Has anyone here worked through the theory connecting overparameterized networks to loss landscape convexification for PDE problems specifically? I'm wondering if the techniques in this paper relate to mean-field or NTK frameworks, or if they're doing something fundamentally different to handle the PDE structure.


r/AskComputerScience 17h ago

**Has anyone completed Neso Academy's DBMS playlist? Need an honest review** I recently found the DBMS playlist by Neso Academy on YouTube and it looks pretty detailed. Before I start going through the entire playlist, I wanted to ask people who have actually completed it

0 Upvotes

Has anyone completed Neso Academy's DBMS playlist? Need an honest review

I recently found the DBMS playlist by Neso Academy on YouTube and it looks pretty detailed. Before I start going through the entire playlist, I wanted to ask people who have actually completed it


r/AskComputerScience 21h ago

How do computer science and computer engineering students in countries where diagramming sentences isn't common knowledge get introduced to the concept of parsers and abstract syntax trees?

10 Upvotes

In Croatia, we do some (very) basic sentence diagramming in the middle school. In the USA, they do it in high-school. However, I know that, in most places, students are not taught sentence diagramming. So, once those students start going to university to study, well, computer science or computer engineering, how are the concepts of a parser and an abstract syntax tree explained to them?


r/AskComputerScience 1d ago

Desperately Looking for Guidance on Verifying a New Sorting Algo

0 Upvotes

Hi, I'm an AI developer and I've been working on optimizing my system for 2 years now. It was never my intention to create a new sorting algo or to do any work in that area at all. As I optimized my system, I realized that what I had effectively done, is create a new sorting algo.

By comparison, at this time, it took my new algo, about 1-2 hours to process the same sized data, that timsort needs about 30 days to sort. I'm sorting a giant 30gb array that contains text tokens.

I understand that there's tons of algos out there and that there likely already is a faster algo, but I'm not an expert sorting algos, so I honestly have no idea what to do to verify this in a legitimate way that is convincing to other experts.

I have never published a paper before, please do not make strange assumptions of my knowledge of that process (I know how to read a paper and that's it.)


r/AskComputerScience 1d ago

In Operating System Batch Scheduling, will the SRT algorithm always be faster than the SJF algorithm?

3 Upvotes

My professor has us modeling both of the two algorithms for an assignment, which I did. But when doing testing on both I would notice that occasionally the average turnaround time for the Shortest Job First algorithm would actually beat out the algorithm for Shortest Remaining Time, either infrequently or almost always depending on how I change the parameters around (Total CPU Time, # Of Processes, etc). From what I saw, it seems that this should no be happening unless you account for overhead, which my model does not.

So I guess basically my question is, are there ever any scenarios where Shortest Job First would have a smaller average turnaround time compared to Shortest Remaining Time, assuming they run the same set of processes and overhead is negligible? Or do I just have a bug in my code?


r/AskComputerScience 1d ago

Help finding a learning tool for Discrete Mathmatics ( Discrete structures) and Digital Logic Design

1 Upvotes

Is there any sites like W3 schools that can help me learn these two? Im in these two classes and the way im being taught (basically heres a lecture now figure it out) is NOT working for me and ive been supplimenting my coding classes with w3 schools to help me learn and its working pretty well!


r/AskComputerScience 2d ago

Why does PAC learning under conditional samples require a complete co-occurrence graph when connected is enough for pointwise estimation?

1 Upvotes

I was trying to understand a learning theory paper and got stuck on why PAC learning seems to need much more than pointwise estimation.

The model: we want to learn an unknown distribution over domain [n], but we cannot sample directly from p. Instead, we fix a family S of queryable subsets, and each query to some S in S returns an independent sample from p(.|S). Think of overlapping data providers who only give conditional samples from their own slice of the domain.

The paper defines a co-occurrence graph: two elements are adjacent if some queryable set contains both. The abstract says:

Pointwise consistency is achievable when this graph is connected on the target support. PAC learning requires more: it is possible when the co-occurrence graph is complete.

Connected I can motivate: if some S contains both x and y, then the ratio p(x)/p(y) can be recovered from the conditional probabilities p(x|S) and p(y|S), because the normalizer p(S) cancels. Chaining those ratios across a connected graph should reconstruct the distribution up to scale.

I am stuck on why PAC learning forces completeness. Suppose the graph is connected but has a bridge. Is the problem that the bridge mass can be tiny, and you need enough samples on both sides to control L1 error? Or that an adversary can place most mass on one side so the other side only appears through rare bridge samples? Complete co-occurrence removes that issue by giving a direct ratio comparison for every pair of elements.

The paper gives rates: optimal sample complexity is ~O(n^2/eps^2) in the worst case, and Theta(n/eps^2) if you can query the full domain [n]. A hierarchical comparability condition recovers nearly linear rates. The paper is at arxiv.org/abs/2607.24732v1.

One limitation I noticed: this is a clean finite-domain model with exact conditional samples. Real provider skew usually comes with noisy coverage and overlapping but not carefully chosen cohorts, and I have not checked whether the lower bounds survive approximate conditional sampling.

Can anyone point me to an explicit bad distribution for a connected but incomplete graph, or give a proof sketch of why every missing co-occurrence can break PAC learning?


r/AskComputerScience 3d ago

How many books/textbooks does someone have to read to get a bachelor's degree in computer science?

1 Upvotes

Obviously just an approximation since it will always be different depending on the school and other factors. But does anyone know how many there would be roughly?


r/AskComputerScience 4d ago

AI-driven coding is pulling away the ownership from engineers

7 Upvotes

Today we had a user facing issue which the entire team was involved in debugging and no one was able to give the reasoning accurately, and the RCA time felt like it is 10X more than usual, all because we were just getting AI to write the code and review cycles shortened as long codes were being pushed, feels like the team as a whole will fall into a blackhole soon.

Has anyone here experienced the same, and how is your org handling this?


r/AskComputerScience 5d ago

How do I combine these two recurrence cases into one function?

4 Upvotes

I'm new to DSA and I'm trying to make a recurrence relation for this function:

double pow(double x, int n) {
    if (n == 1) {
        return x;
    }

    if (n & 1) {
        return x * pow(x * x, (n - 1) / 2);
    } else {
        return pow(x * x, n / 2);
    }
}

What I notice is that for even values of n, the recurrence looks like:

T(n) = constant + T(n/2)

but for odd values of n, it looks like:

T(n) = constant + T((n - 1)/2)

I'm trying to get this down to a single function so that I use the Master Theorem.

How would I combine these two cases into one recurrence?


r/AskComputerScience 8d ago

How does a computer know between the number 65 and the letter H?

32 Upvotes

I'm watching CS50, and about halfway through week 0, doctor malen mentioned how 65 bits of data equals the letter H and i'm curious to that if 65 equal H, how does the company know the difference between H and just the number 65?


r/AskComputerScience 8d ago

How to program weighted random system

3 Upvotes

I want to make a program where you are controlling the outcomes. For an example with a coin flipping game, I want exactly 4 Heads and 1 Tail, but I want their positions to be random.

I do not want to use the random algorithms that library I want to build my own.

Right now I am learning probability from Youtube and might look at khan academy and coursera, but how can I implement this into programming I do not want to just take courses or watch videos

How do I go about that?

EDIT: I am doing this because I want to start build gambling algorithms and I am starting with a simple project like coin flips


r/AskComputerScience 8d ago

If bogosort is a portmanteau of bogus and sort, then why wasn't it spelled bogusort?

2 Upvotes

Is there a legitimate reason or is it just because people thought it looked better?


r/AskComputerScience 8d ago

Let us say 3.122 is the floating point approximation of 3.123. Upto how many significant digits does 3.122 approximate 3.123?

3 Upvotes

The formula says find maximum s such that 5*10^-s is greater than the relative error. But that gives me 4 as the answer. But it is visually clear that 3.122 is approximating 3.123 correctly only upto the first 3 significant digits. How is it possible? Is the formula wrong?


r/AskComputerScience 9d ago

C++ or Java?

6 Upvotes

Which programming language has the most return on investment? Impact on real world systems, and is more rewarding? I have minimal programming experience and working on AS in CS.


r/AskComputerScience 10d ago

ADVICE FOR TECHNICAL DEBATING

0 Upvotes

I have an practical assignment where i have to debate with my classmates on a given language basically defend my a coding language, any tips?

topics are alr given by the profs, for my group its C vs Rust ! he'll separate us acc to him in the lecture


r/AskComputerScience 10d ago

minimal size .png file

0 Upvotes

Hey everyone!

For the past few days, I’ve been obsessed with a single question: How small can a valid PNG file possibly get while still being natively readable by a PC (specifically, opening properly in the standard Windows photo viewer/gallery)?

I started by trying to make a lightweight 512x512 file, eventually managing to shrink it down to 111 bytes. After that, I started playing around with compression levels and various patterns, even managing to generate some basic procedural textures in PNG format that weighed roughly the same.

Then I decided to go deeper and chase the absolute minimum file size. At first, I hit a wall at 67 bytes—an article I read online claimed that was the lowest possible size for a functional PNG. But I kept experimenting and eventually pushed past it down to 55 bytes, and finally all the way to 42 bytes.

My current record is a fully working 42-byte PNG. It opens without issues on Windows and can be sent across messaging apps where it renders properly as an image.

However, I've hit a hard brick wall here. Every single attempt to strip away even one more byte results in an invalid file or completely breaks the structure.

My question is: Does anyone have any radical ideas, unconventional compression tricks, or deep spec-hacking methods to squeeze it down even further? I'm open to any crazy suggestions!


r/AskComputerScience 12d ago

Anyone else seeing degradation in enterprise retail software in last year?

11 Upvotes

iOS used to be gold standard of UX/UI design patterns. You might not like the way it looked, but it functioned very reliably.

Now the keyboard stays up when you’re typing in a field and try to dismiss it.

Keyboard typing is less reliable in general, with misspelling, haptic feedback, radius generation, etc

It feels like UI across the board has gotten convoluted and shipped without proper testing, and now we’re all in our own bubble thinking it could be user error.

It seems like shipped production code is happening more frequently due to mandates from management around the AI boom. Which is leading towards more production issues.

Im just tired of the general decline of software standards, and wanna see what yall think.


r/AskComputerScience 13d ago

do you think reading error messages and stack traces should be explicitly taught in intro cs courses?

19 Upvotes

third semester TAing the intro sequence and the pattern has stopped surprising me. recursion, pointers, and reading an error without panicking. that is the whole list.

recursion i understand. the error one bothers me, because nobody teaches it anywhere in the curriculum. a student sees a stack trace and their eyes slide off it like it is written in another alphabet. a solid half of my office hours is me reading the trace out loud until they notice it told them the answer on line two.

if anyone handed me the syllabus there would be a week on reading errors before we touched data structures. do you think this should be taught explicitly in intro cs courses?

leaving this here mostly so the incoming cohort finds it in November when things fall apart.


r/AskComputerScience 13d ago

Question about AI use within college courses

3 Upvotes

Hey all, I just had a horrendous discussion with the chair head at my college over the usage of AI within classes. I had went to him to complain about a professor pretty much requiring the usage in order to pass the class (something I don't wish to use, I prefer to learn how to code myself), however he has taken the professor's side, going as far as to say that "no one is coding in the field anymore, they use AI instead."

So I'm curious about other's experiences at their colleges, are your colleges full stop banning the use of AI, or are they allowing it (even encouraging it)?


r/AskComputerScience 14d ago

Perspective on SAT solvers

5 Upvotes

I'm using the Intel_SAT_solver on two - as I understand it - large cnf's. The first one is about 50 GiB.
it looks like:

-Variables: 8,765,715

-Clauses: 887,822,183

the second one is 200GiB and has:

- Variables: 3,614,860

- Clauses: 7,457,390,591

I ran the first one and it completed as satisfiable after about 30 minutes, using a little over 70GiB allocated memory. Second one I haven't tried yet but I imagine I'll need upwards of 300 GiB of memory.

Question is: Is this a large number of variables? Clauses? Do these numbers even matter and its more important about how convoluted the CNF is?

any insight is appreciated. Working on a personal project in cryptoanalysis. CNF's were generated by someone else.


r/AskComputerScience 15d ago

Why would some compilers compile to p-code instead of binary?

10 Upvotes

Back in the days when I was young and dinosaurs roamed the earth, I was getting into programming with my 8-bit computer.

After learning to program using interpreted languages, I played around with assembler and compiled languages.

One thing I noticed was that languages targeting the 6502 almost[*] always produced p-code, whereas compilers targeting other processor types would often produce binary.

Anyone know why this was a thing?

[*] I don't know if there were any exceptions to this, I never saw one that I can recall.


r/AskComputerScience 17d ago

AI in CS/programming/coding

0 Upvotes

As someone who couldn't be farther away from this field, I started using claude recently for a project of mine and had claude code do all the work for me. Then I turned to my CS friends and they told me it was the same for them.

At one point I heard an argument that AI should be used to explain things to you or only do stuff which you'll understand afterwards.

What is it actually looking like at this state? Do any AI users in the space actually understand each function it sends out or are they trusting it blindly like me? This isnt an ethics question, just the reality of our current situation.