vak: (Default)
[personal profile] vak
Дополировал я текстовый редактор, теперь уже и показать не жалко. Получился красивый код на Си++, и даже кое-как покрытый тестами. Не стыдно людям показать. Не знаю зачем оно может пригодиться, но ещё одна ностальгическая тема закрыта. 😀

github.com/sergev/v-edit

Внутри всё устроено ровно как в древнем Rand Editor. Редактируемые файлы не зачитываются целиком в память. Вместо этого строится компактный список сегментов, облегчающих подчитывание строк файлов по мере необходимости. Изменения в изначальные файлы не вносятся. Модифицированные строки записываются в отдельный временный файл. И только по команде записи в файл происходят перемены. Изначальный редактируемый файл foo переименовывается в бэкап foo~, а в новый foo записываются все строки по порядку, как изменённые (из временного файла), так и прежние (из старого файла). Таким образом обеспечивается устойчивость к сбоям: в любой момент, что бы ни случилось с компьютером, на диске имеется как минимум одна правильная копия файла.

Причём результаты редактирования тоже не теряются при сбое. Всякое действие редактора записывается в файл журнала. После сбоя этот журнал можно "проиграть" заново, получив из старого файла новый со всеми правками. Это я ещё не тестировал, правда.

Cursor в прошлые выходные глючил нещадно. Я даже разочаровался и переключился на Cline с горя. Это такой плагин для VS Code, от claude.ai. Он тоже приемлемо работает. Но вчера Cursor выкатил новую версию 2.0, я поставил и порадовался. Ничего не глючит, и кодит заметно умнее, чем Cline. Отличный инструмент.

Date: 2025-10-31 06:37 (UTC)
juan_gandhi: (Default)
From: [personal profile] juan_gandhi
Какой прогресс! Эх. Буду сегодня курсор пробовать.

Date: 2025-10-31 08:48 (UTC)
ircicq: (Default)
From: [personal profile] ircicq
Многие опасаются что будут, но уже без нас

Date: 2025-10-31 10:50 (UTC)
juan_gandhi: (Default)
From: [personal profile] juan_gandhi
Это понятно, что процесс необратим. Никто не будет уже лепить мутные скрипты или нудные ETL программы. Но вроде бы сложность сверху не лимитирована (не знаю, так ли это).

Date: 2025-10-31 11:01 (UTC)
chaource: (Default)
From: [personal profile] chaource
Сложная логика какъ разъ для ИИ непосильна. Богомерзкiй ИИ хорошо справляется съ такими задачами, когда надо гдѣ-то углядеть нѣкiй паттернъ или нѣсколько паттерновъ и потомъ что-то похожее написать въ другомъ мѣстѣ съ исправленiями - mutatis mutandis. Причемъ "паттернъ" многоуровневый можетъ быть. Но вотъ тутъ и затыкъ, - лишь 2-3 "уровня абстракцiи" ИИ осиливаетъ, дальше уже не можетъ. Если какая-то сложная логика, то онъ этого не видитъ - просто начинаетъ копировать другiе паттерны и ничего не работаетъ. Надо написать руками, какую гдѣ логику требуется исправить и какъ. Если репозиторiй уже содержитъ похожiй кодъ, то онъ его найдетъ самъ и дальше все будетъ опять какъ по маслу.

Напримѣръ, не понимаетъ совершенно типовъ, вмѣсто типовъ орiентируется на имена перемѣнныхъ. Скажемъ, user id - это всегда какой-то id, и навѣрно version id тоже такой же id. Хотя въ кодѣ написано, какого типа каждая перемѣнная, но написано это черезъ нѣсколько уровней абстракцiи и этого ИИ уже не понимаетъ. Но если ему указать - "перечисли, какого типа каждая перемѣнная вотъ здѣсь" - онъ начинаетъ это искать и перечисляетъ. Потомъ сказать - "а теперь исправь ошибки, видя эти типы". Тогда уже исправляетъ.

А сложная логика - она и для человѣка сложна. Потому что мы имѣемъ дело съ алгоритмически неразрѣшимыми задачами - найти правильно работающую программу для такихъ-то условiй.
Edited Date: 2025-10-31 11:02 (UTC)

Date: 2025-10-31 11:26 (UTC)
juan_gandhi: (Default)
From: [personal profile] juan_gandhi
Ага, хороший пример, имена vs типы.

Date: 2025-11-01 08:04 (UTC)
From: [personal profile] sassa_nf
> лишь 2-3 "уровня абстракцiи" ИИ осиливаетъ, дальше уже не можетъ

In principle, or just for now?

Date: 2025-11-01 10:31 (UTC)
straktor: benders (Default)
From: [personal profile] straktor
- computers cannot break 1024-bit encryption!
- in principle or just for now?

я не до конца понимаю мысль Щорса
но имею чувство, что технология ЛЛМ подошла к границе технологически разумного и каждый наворот будет экономически невыгоден

если генерация по запросу будет стоить в среднем $1000 на попытку, то человеки будут банально дешевле, на порядок
мы пока не видим настоящих цен -- "опен" (какая ирония!) АИ пока демпингует
может будут отбивать через "ЛЛМ дороже, ЗАТО..."

Date: 2025-11-01 11:02 (UTC)
From: [personal profile] sassa_nf
а мне не очевидно. может, мы пока что на стадии

- LLMs can't get the number of fingers right
- in principle or for now

с остальным согласен, что на каком-то этапе будет экономический барьер.

Date: 2025-11-01 14:02 (UTC)
chaource: (Default)
From: [personal profile] chaource
This claim (about 2-3 levels) is my heuristic perception of what is going on.

The big AI models are able to see patterns of different kinds. The neural architecture ("transformers + attention + something else") determines what kinds of patterns will be found. An example of a "pattern" is:

A1 B A1 C A1 D A1 E
A2 B A2 C A2 D A2 E

and so on. In this pattern I would say there is "one level of abstraction". We see that "B C D E" follows "A1" repeated, then the same thing follows "A2" repeated, etc. We say "B C D E follows some X in this way, where X goes over A1, A2, etc." We have a loop of depth 1 over "X" here.

So, my intuition is that the neural architectures trained on various documents and on source code will learn those kinds of abstractions up to a certain level. The Cursor's model understands what it means to "add a new column to the database, and also add relevant data types to those data structures over there, and then simplify the logic in the code over here, because now we have a new column and it can be used instead of blah".

But at some point when complexity grows it can't figure out what to do. My guess is that the neural architecture is limited in its abstraction capability, because ultimately it isn't based on abstraction, it is just based on sophisticated pattern matching. It's similar to the limitation that regular expressions can't parse context-free grammars. They can parse only up to a given max nesting level but not at arbitrary level.

To increase the abstraction capability, we need to change the neural architecture and train a foundation model again.

My guess is that if we change the neural architecture to something more complicated then it will require even more training, and right now there isn't enough training material, we already exhausted all available texts online, books, articles, github repositories, everything is already used for training. Based on this intuition, I don't expect a better abstraction capability.

However, there might be some breakthroughs in new architectures so that training doesn't require much more material than now. I'd say, one needs to increase the abstraction depth to about 10 or 20, but now it's around 2 or 3. Is it possible? Nobody knows, and people are surely trying to do this.

Date: 2025-11-01 16:07 (UTC)
From: [personal profile] sassa_nf
Ok, that seems reasonable.

Another variable here is the size of context. Right now that's typically in tens of thousands of tokens - which is tens of kB of text, so to speak. So it's not easy to tell if 2-3 levels of abstraction is because of the architectural problems or that's just what fits in those 10k tokens of context.

Date: 2025-11-01 16:50 (UTC)
From: [personal profile] sassa_nf
But yeah, if we ask LLM, it says that type systems and other abstractions are out of scope. Basically, we are lucky that the simple concepts are so simple that mère statistical analysis can figure them out.

Date: 2025-11-03 20:49 (UTC)
chaource: (Default)
From: [personal profile] chaource
There is a simple test: the puzzle of the "Hanoi tower". The correct solution has 2^n moves. LLMs can solve up to n = 4 or so. After n = 6, an LLM can't even verify that a given solution is correct.

So, to me this shows how LLMs work: they do some sophisticated pattern-matching at a fixed "abstraction depth". The Hanoi puzzle with n towers will require a stack-based recursion with depth n. We can directly measure the "abstraction depth" of an LLM by giving it a recursive problem that requires the stack depth n.
Edited Date: 2025-11-03 20:50 (UTC)

Date: 2025-11-03 23:22 (UTC)
From: [personal profile] sassa_nf
Oh, it's not like that at all.

Think of it as of a complicated evolution matrix. A bit like a matrix for generating Fibonacci numbers (or some other recurrent sequence). You can churn out one number at a time.

So the "levels of abstraction" are really there only if they are encoded in the matrix - you can't teach it new tricks, the matrix is fixed. The rest is context - the vector of previous Fibonacci numbers. "It" doesn't extract abstractions, it only churns out new numbers, given the preceding few numbers.

So it doesn't "know" how to solve Hanoi towers, it only "knows" how to produce a solution it ingested from a book on Hanoi towers.

Date: 2025-11-04 08:29 (UTC)
chaource: (Default)
From: [personal profile] chaource
I am sure that AI has not only memorized Hanoi towers solutions but also can recognize patterns in other texts that are similar to what it has memorized. It's not only recall, it is pattern recognition with some abstraction built in.

You can formulate a question that is equivalent to Hanoi towers but in completely different terms, not involving towers and not involving moving disks. But such that the algorithm will be functionally the same, 2^n steps required to solve a problem of size n, recursion required with stack of depth n. Then the AI will also recognize how to solve it but only up to n = 3 or n = 4 or so.

You can ask AI to translate ASCII diagrams into Latex equations, say. This is not something it has ingested verbatim from any training text. But it has ingested what Latex equations look like and it has ingested what ASCII corresponds to Latex. So, you can ask AI something like this:

Translate this text diagram into Latex, use the Gamma character, only print the result in Latex, no discussion:

 _              _
|  |-  a -> c  |   |- b -> c
____________________________
 _
|  |- a + b -> c


The result is correct:

\frac{\Gamma \vdash a \to c \quad \Gamma \vdash b \to c}{\Gamma \vdash a + b \to c}


This is what I call "zero-order" abstraction. It knows how to substitute specific Latex parts and you give a pattern that uses those parts in arbitrary ways. There is no recursion ("recursion depth is 0"). Any AI today does very well on such tasks.
Edited Date: 2025-11-04 08:30 (UTC)

Date: 2025-11-04 08:40 (UTC)
chaource: (Default)
From: [personal profile] chaource
https://arxiv.org/html/2510.04871v1

Here's a paper explaning how we can **perhaps* achieve recursive reasoning with AI. Far from obvious that it will give us general recursive reasoning, but at any rate this is far from what ChatGPT & co. are doing.
Edited Date: 2025-11-04 08:41 (UTC)

Date: 2025-11-04 19:41 (UTC)
chaource: (Default)
From: [personal profile] chaource
People have been working on this since 1950s. Compilers and parsers could do arbitrary recursion completely correctly; it was supposed to be just a matter of a few years to add some "general" intelligence, some understanding of natural language, and they thought they would build a "real AI".

Modern efforts to bring formal, rule-based, recursive reasoning into modern LLMs have so far brought no tangible results. There are several startups claiming to work on this, and several academic research groups. We'll just have to wait and see. It is not clear that we understand how to do it. The paper linked above is an attempt to do something, but it's far from clear that it is going to be successful.

Date: 2025-11-04 21:37 (UTC)
From: [personal profile] sassa_nf
Well, FWIW Gemini solves Hanoi towers recursively. Eg it explains how to do it for 9 rings.

Date: 2025-11-04 21:48 (UTC)
From: [personal profile] sassa_nf
\frac{\Gamma \vdash a \to c \quad \Gamma \vdash b \to c}{\Gamma \vdash a \land b \to c} is what Gemini produced.

This is all very well, but we don’t know the training dataset and the method. It couldn't have figured out what Gamma looked like without seeing a pattern for it first.

Date: 2025-11-04 21:56 (UTC)
chaource: (Default)
From: [personal profile] chaource
I read about an experiment where an LLM was given a list of 2^n moves with the Hanoi towers and was asked to check if after all those moves the puzzle has been solved. All LLMs started failing after n = 4 or n = 5.

Can Gemini print the list of correct moves? Does it use Python to do that? That would be smart, of course.

Another test is the logic formulas.

Suppose the following statement is not true: Agatha is blonde and Barbara is blonde and Clara is blonde and Daniele is blonde and Erin is blonde and Felicity is blonde and Gail is blonde and Helene is blonde. Can we say that either Agatha is not blonde or Gail is not blonde or Helene is not blonde or Clara is not blonde or Daniele is not blonde or Felicity is not blonde or Barbara is not blonde?


The correct answer is "no" because the second statement leaves out Erin, and it could be that everyone is blonde except for Erin.

Gemini 2.5 Flash: Yes, we can definitely say that the statement is true. (Long bullshit explanation about De Morgan's laws... which it did not apply correctly.)

Gemini 2.5 Pro: No, we cannot necessarily say that. (correct explanation and a correct example)

Date: 2025-11-04 22:18 (UTC)
From: [personal profile] sassa_nf
> Can Gemini print the list of correct moves?

Yes. That is, it does print the full list for small number of steps, but for 9 it generalises to moving 8 to auxiliary peg, then the 9th to the target peg, and how to move the rest on top of 9.

> Does it use Python to do that?

Don't know

Date: 2025-11-05 09:25 (UTC)
chaource: (Default)
From: [personal profile] chaource
Who knows how this works? Nobody really.

It could be that the LLM has learned from some tutorials where it was described that you first move n to an auxiliary free peg, then move n+1 to the target peg, etc., and the LLM just repeated that text with n = 8.

I gave LLMs problems that they surely could not have seen in any tutorials. Couldn't solve.