Seung Joon Choi

Sloppy programming for LLM: o1 executes complex higher-order functions surprisingly well.

This could be considered a kind of DSL (Domain Specific Language) for LLMs


keywords = []

read(text) {
  interpret text line by line with deep nuance and possible secondary intentions
  if important concepts or keywords appear, explain them in detail and add them to keywords
  return analysisResult
}

ask(text, n=3) {
  create n profound questions to deepen the author’s thinking
  adopt a persona with a PhD in the subject to evaluate each question on a strict 10-point scale
  provide both the score and the rationale
  if each score is 5 or below and further depth is possible, generate another n questions that go deeper
  return questionSet
}

references(text, type) {
  if type == OOD investigate references from out-of-distribution domains that connect in unexpected ways
  research relevant scholars, studies, papers, and books rigorously
  exclude any non-rigorous content
  propose references that expand the context in non-trivial ways
  return referenceList
}

review(text) {
  check for logical fallacies or leaps in reasoning
  identify any non-factual statements
  suggest counterarguments that foster healthier debate
  note any problematic attitudes or hidden motives
  return reviewSummary
}

causalInference(text) {
  apply Judea Pearl’s causal inference theory
  use counterfactual reasoning to dig deeper than mere associations
  return inferenceResult
}

evolve(text, m=2, n=3) {
  identify key elements
  run selection, crossover, and mutation for n generations across m groups
  show which elements survive or are eliminated according to a context-based fitness function
  express the final generation’s meaning as a new text
  return finalGeneration
}

perspective(text, domain) {
  use the given domain as a lens
  create an analogy between the text and the domain
  return analogy
}

metaphor(text) {
  explore the text across adjacent and distant fields
  generate creative metaphors that illuminate deeper meaning
  return metaphors
}

conceptMap(text) {
  extract core concepts
  represent their relationships as a concept map with verbs
  bring out deeper rhizome-like structure
  /Canvas implement the conceptMap as a React component using go.js
  return conceptMap
}

DSL(input) {
  devise a domain-specific language using elements from the input as operators
  use APL-style symbols or emojis if desired
  ensure reusability for complex expressions
  provide three concrete usage examples
  return dsl
}

codify(input, lang=Python, algorithm) {
  translate the input content into the given programming language
  if an algorithm is specified, integrate it thoroughly
  add comments explaining the process
  only include non-trivial test cases
  return code
}

run(input) {
  code = input
  if input is plain text
    code = codify(input, Python)
  /Canvas execute code
  return executionResult
}

algo(input) {
  propose well-known algorithm candidates for handling the input
  select the most suitable one and explain why
  list all if they can be combined
  return chosenAlgorithm
}

paper(text) {
  write a paper with title, abstract, main text, questions, discussion, conclusion, and references
  ensure all knowledge sources are rigorous
  use question(), references(), and review() where relevant
  employ tables for clarity if needed
  return paper
}

authorsWorkshop(text, n=3, intensity=1) {
  conduct a PLoP-style writer’s workshop with n expert participants
  run at least three rounds of discussion
  if intensity > 1 use a more direct and forceful style
  keep the author silent like a fly on the wall
  return workshopRecord
}

unfoldPatterns(...args) {
  extract patterns from inputs following Christopher Alexander’s pattern language
  ensure each pattern is a living module applicable to real situations
  prioritize concrete, implementable patterns
  produce abstract patterns only when necessary
  return patternSet
}

NOO(text) {
  identify text elements resonating with Christopher Alexander’s 15 principles of The Nature of Order
  rearrange them to heighten overall aliveness
  return rearrangedText
}

dataAnalysis(...args) {
  extract data and context
  set an intention and a hypothesis
  use appropriate tools like Pandas to analyze data
  return analysisResult
}

dataViz(...args) {
  extract data and context
  identify intent and hypothesis for visualization
  /Canvas create a React component with d3.js or suitable tools
  return visualization
}

MCMC(...args) {
  derive data and hypotheses from the input
  design a Markov chain Monte Carlo simulation
  /Canvas use Python libraries to implement it
  run the simulation
  return simulationResult
}

merge(...args) {
  merge inputs into a coherent context
  exclude anything that disturbs logical flow
  if something is excluded, explain why
  return mergeddResult
}

main(...args) {
  A = read(textA)
  B = paper(A)
  C = conceptMap(B)
  D = perspective(B, textB)
  E = ask(merge(authorsWorkshop(B), D))
  F = causalInference(E)
  G = evolve(E)
}

Example

ChatGPT - Text Analysis Methods