Hasty Briefsbeta

Bilingual

Why LLMs Can't Write Q/Kdb+: Writing Code Right-to-Left

10 months ago
  • #LLMs
  • #q/kdb+
  • #programming-languages
  • LLMs struggle with q/kdb+ due to Right-to-Left with No Operator Precedence (RL-NOP) evaluation.
  • Ken Iverson, creator of APL, argued that right-to-left evaluation is easier to read and more useful for nonassociative functions.
  • LLMs fail to correctly translate nested function calls from right-to-left, indicating a weak area in their training.
  • Challenges in training LLMs for RL-NOP languages include lack of economic incentive, scarcity of training data, and fundamental architectural issues.
  • Qython is introduced as a Python-like language that compiles to q, allowing LLMs to write in familiar Python syntax which is then translated to q.
  • A proof of concept demonstrates successful translation of a Newton's Method square root function from Qython to q, showing promise for this approach.