News for hackers. Stuff that matters.
Re:Notes on OpenAI's new o1 chain-of-thought models by tptacek on Thursday September 12, 2024 @10:34PM (#41527588)
I use LLMs for three things:

* To catch passive voice and nominalizations in my writing.

* To convert Linux kernel subsystems into Python so I can quickly understand them (I'm a C programmer but everyone reads Python faster).

* To write dumb programs using languages and libraries I haven't used much before; for instance, I'm an ActiveRecord person and needed to do some SQLAlchemy stuff today, and GPT 4o (and o1) kept me away from the SQLAlchemy documentation.

OpenAI talks about o1 going head to head with PhDs. I could care less. But for the specific problem we're talking about on this subthread: o1 seems materially better.

Re:Notes on OpenAI's new o1 chain-of-thought models by throwup238 on Thursday September 12, 2024 @10:40PM (#41527624)
> * To convert Linux kernel subsystems into Python so I can quickly understand them (I'm a C programmer but everyone reads Python faster).

Do you have an example chat of this output? Sounds interesting. Do you just dump the C source code into the prompt and ask it to convert to Python?

Re:Notes on OpenAI's new o1 chain-of-thought models by tptacek on Thursday September 12, 2024 @10:46PM (#41527641)
No, ChatGPT is way cooler than that. It's already read every line of kernel code ever written. I start with a subsystem: the device mapper is a good recent example. I ask things like "explain the linux device mapper. if it was a class in an object-oriented language, what would its interface look like?" and "give me dm_target as a python class". I get stuff like:

    def linear_ctr(target, argc, argv):
        print("Constructor called with args:", argc, argv)
        # Initialize target-specific data here
        return 0
     
    def linear_dtr(target):
        print("Destructor called")
        # Clean up target-specific data here
     
    def linear_map(target, bio):
        print("Mapping I/O request")
        # Perform mapping here
        return 0
     
    linear_target = DmTarget(name="linear", version=(1, 0, 0), module="dm_mod")
    linear_target.set_ctr(linear_ctr)
    linear_target.set_dtr(linear_dtr)
    linear_target.set_map(linear_map)
     
    info = linear_target.get_info()
    print(info)
(A bunch of stuff elided). I don't care at all about the correctness of this code, because I'm just using it as a roadmap for the real Linux kernel code. The example use case code is an example of something GPT 4o provides that I didn't even know I wanted.
Re:Notes on OpenAI's new o1 chain-of-thought models by throwup238 on Thursday September 12, 2024 @10:50PM (#41527672)
That's awesome. Have you tried asking it to convert Python (psuedo-ish) code back into C that interfaces with the kernel?
Re:Notes on OpenAI's new o1 chain-of-thought models by tptacek on Thursday September 12, 2024 @11:01PM (#41527720)
No, but only because I have no use for it. I wouldn't be surprised if it did a fine job! I'd be remiss if I didn't note that it's way better at doing this for the Linux kernel than with codebases like Zookeeper and Kubernetes (though: maybe o1 makes this better, who knows?).

I do feel like someone who skipped like 8 iPhone models (cross-referencing, EIEIO, lsp-mode, code explorers, tree-sitter) and just got an iPhone 16. Like, nothing that came before this for code comprehension really matters all that much?

Re:Notes on OpenAI's new o1 chain-of-thought models by INGSOCIALITE on Thursday September 12, 2024 @11:11PM (#41527755)
it's all placeholders - that's my experience with gpt trying to write slop code
Re:Notes on OpenAI's new o1 chain-of-thought models by throwup238 on Thursday September 12, 2024 @11:16PM (#41527784)
Those are placeholders for user callbacks passed to the device mapper subsystem. It’s a usage example not implementation code.
Re:Notes on OpenAI's new o1 chain-of-thought models by jeffhuys on Friday September 13, 2024 @02:38AM (#41528591)
Then ask it to expand. Be specific.
Re:Notes on OpenAI's new o1 chain-of-thought models by tptacek on Friday September 13, 2024 @10:54AM (#41531797)
I wasn't about to paste 1000 lines of Python into the thread; I just picked an interesting snippet.