$30 off During Our Annual Pro Sale. View Details »

Man Bites Dog: A Journey of LLMs and What Comes Next

Xuanyi
November 03, 2023

Man Bites Dog: A Journey of LLMs and What Comes Next

Presented at GopherConSG 2023

LLMs like GPT-4 have gained popularity recently, raising questions about their capabilities and general intelligence - mostly written in Python, seemingly leaving Gophers out in the cold. However, that couldn't be more false. In this talk I'll explore where Go can go in an LLM-filled future.

Xuanyi

November 03, 2023
Tweet

More Decks by Xuanyi

Other Decks in Technology

Transcript

  1. Gorgonia, a Go programming
    language library for machine
    learning.
    The robotic dog, named
    "GPT-K9", reportedly reacted
    to the bite with an error
    message: "Syntax error:
    unexpected bite."
    GPT-K9 was last seen entering
    a blue police box with the
    doctor.
    The
    Concurrent Times.
    Friday, 3 November 2023
    MAN BITES DOG!

    In a bizarre twist of events, a
    linguist studying word order
    bit a dog during a conference
    on large language models. Dr.
    Noam Lingo, while presenting
    his research on how word order
    affects perception, used the
    classic example "Man bites
    dog" versus "Dog bites man".
    To demonstrate, he playfully
    "bit" a robotic dog powered by
    Xuanyi Chew
    Live from Gophercon Singapore

    View Slide

  2. hand : Noun
    pen : Noun
    book : Noun
    read : Verb
    write : Verb
    speak : Verb

    View Slide

  3. hand : Noun
    pen : Noun
    book : Noun
    read : Verb
    write : Verb
    speak : Verb

    View Slide

  4. hand : Noun
    pen : Noun
    book : Noun
    read : Verb
    write : Verb
    speak : Verb

    View Slide

  5. hand : Noun
    pen : Noun
    book : Noun
    read : Verb
    write : Verb
    speak : Verb

    View Slide

  6. hand : Noun
    pen : Noun
    book : Noun
    read : Verb
    write : Verb
    speak : Verb

    View Slide

  7. hand : Noun
    pen : Noun
    book : Noun
    read : Verb
    write : Verb
    speak : Verb

    View Slide

  8. define : Verb
    Show or tell what a word
    means
    example : Noun
    A thing to show to help
    define what a word means

    View Slide

  9. define : Verb
    Show or tell what a word
    means
    example : Noun
    A thing to show to help
    define what a word means

    View Slide

  10. many
    More than one
    order
    Many things in a line

    View Slide

  11. many
    More than one
    order
    Many things in a line

    View Slide

  12. sentence
    Many words in order.
    valid
    Good by the rules.
    grammar
    A set of rules that defines if
    a sentence is valid or not.
    vocabulary
    A set of words where you
    know what a word means.

    View Slide

  13. sentence
    Many words in order.
    valid
    Good by the rules.
    grammar
    A set of rules that defines if
    a sentence is valid or not.
    vocabulary
    A set of words where you
    know what a word means.

    View Slide

  14. sentence
    Many words in order.
    valid
    Good by the rules.
    grammar
    A set of rules that defines if
    a sentence is valid or not.
    vocabulary
    A set of words where you
    know what a word means.

    View Slide

  15. sentence
    Many words in order.
    valid
    Good by the rules.
    grammar
    A set of rules that defines if
    a sentence is valid or not.
    vocabulary
    A set of words where you
    know what a word means.

    View Slide

  16. Language

    Grammar + Vocabulary


    View Slide

  17. S ::= NP VP VP
    NP ::= { n | n ∈ Nouns }
    VP ::= { v | v ∈ Verbs }

    View Slide

  18. S ::= NP VP VP
    NP ::= { n | n ∈ Nouns }
    VP ::= { v | v ∈ Verbs }

    View Slide

  19. S ::= NP VP VP
    NP ::= { n | n ∈ Nouns }
    VP ::= { v | v ∈ Verbs }

    View Slide

  20. 🜣 🜟 ꢯ
    lén katj jìng

    View Slide

  21. Rules of The Lien Language

    S ::= VP NP NP
    NP ::= ꢯ | 🜣
    VP ::= 🜟

    View Slide

  22. Is This Sentence Valid?

    🜣 🜟 ꢯ
    🜣 ꢯ 🜟
    🜟 🜣 ꢯ
    ꢯ 🜣 🜟
    🜟 ꢯ 🜣
    ꢯ 🜣 🜟

    S ::= VP NP NP
    NP ::= ꢯ | 🜣
    VP ::= 🜟

    View Slide

  23. Is This Sentence Valid?

    🜣 🜟 ꢯ
    🜣 ꢯ 🜟
    🜟 🜣 ꢯ
    ꢯ 🜣 🜟
    🜟 ꢯ 🜣
    ꢯ 🜣 🜟


    S ::= VP NP NP
    NP ::= ꢯ | 🜣
    VP ::= 🜟

    View Slide

  24. Is This Sentence Valid?

    🜣 🜟 ꢯ
    🜣 ꢯ 🜟
    🜟 🜣 ꢯ
    ꢯ 🜣 🜟
    🜟 ꢯ 🜣
    ꢯ 🜣 🜟



    S ::= VP NP NP
    NP ::= ꢯ | 🜣
    VP ::= 🜟

    View Slide

  25. Is This Sentence Valid?

    🜣 🜟 ꢯ
    🜣 ꢯ 🜟
    🜟 🜣 ꢯ
    ꢯ 🜣 🜟
    🜟 ꢯ 🜣
    ꢯ 🜣 🜟
    S ::= VP NP NP
    NP ::= ꢯ | 🜣
    VP ::= 🜟




    View Slide

  26. Is This Sentence Valid?

    🜣 🜟 ꢯ
    🜣 ꢯ 🜟
    🜟 🜣 ꢯ
    ꢯ 🜣 🜟
    🜟 ꢯ 🜣
    ꢯ 🜣 🜟
    S ::= VP NP NP
    NP ::= ꢯ | 🜣
    VP ::= 🜟





    View Slide

  27. Is This Sentence Valid?

    🜣 🜟 ꢯ
    🜣 ꢯ 🜟
    🜟 🜣 ꢯ
    ꢯ 🜣 🜟
    🜟 ꢯ 🜣
    ꢯ 🜟 🜣
    S ::= VP NP NP
    NP ::= ꢯ | 🜣
    VP ::= 🜟






    View Slide

  28. syllable
    A sound that the mouth
    makes.

    View Slide

  29. Recap

    Vocabulary = set of words
    Grammar = set of rules
    Language = Grammar + Vocabulary
    = The set of all sentences
    generated by a given
    grammar and vocab

    View Slide

  30. On Word Order

    Verb-Subject-Object: 🜟 🜣 ꢯ
    Subject-Verb-Object: man bites dog
    Subject-Object-Verb: 男が犬を噛む

    View Slide

  31. Murrinhpatha Has Free Word Order

    ku were bangamlele kardu
    kardu bangamlele ku were

    View Slide

  32. Sublanguages

    Language A is a sublanguage of Language B if all the sentences
    in A is contained in the set of all sentences in B.

    View Slide

  33. Examples of Sublanguages

    Written English ≺ English
    Written English ≺ Internet Text
    Go Programming Language ≺ Internet Text

    View Slide

  34. Gold’s Theorem


    Speaker

    Listener

    View Slide

  35. Gold’s Theorem


    Teacher

    Learner
    S ::= VP NP NP
    NP ::= ꢯ | 🜣
    VP ::= 🜟 | ⩹
    🜟 🜣 ꢯ
    ⩹ 🜣 ∅

    View Slide

  36. Gold’s Theorem


    Teacher

    Learner
    S ::= VP NP NP
    NP ::= ꢯ | 🜣
    VP ::= 🜟 | ⩹
    🜟 🜣 ꢯ
    ⩹ 🜣 ∅

    L
    1
    L
    2

    L
    n
    L


    L
    k

    View Slide

  37. Gold’s Theorem


    Teacher

    Learner
    S ::= VP NP NP
    NP ::= ꢯ | 🜣
    VP ::= 🜟 | ⩹
    🜟 🜣 ꢯ
    ⩹ 🜣 ∅

    L
    1
    L
    2

    L
    n
    L


    L
    k
    🜟 🜣 ꢯ

    View Slide

  38. Gold’s Theorem

    L
    1
    , L
    2
    , … L
    n
    , L

    , L
    k
    , …

    Listener

    Speaker

    View Slide

  39. Gold’s Theorem

    En, Zh, … JS, L

    , Go, …

    Listener

    Speaker

    View Slide

  40. Gold’s Theorem

    En, Zh, … JS, L

    , Go, …

    Listener

    Speaker
    func I[T any](x T) T {
    return x
    }

    View Slide

  41. Gold’s Theorem

    En, Zh, … JS, L

    , Go, …

    Listener

    Speaker
    func I[T any](x T) T {
    return x
    }

    View Slide

  42. Gold’s Theorem

    En, Zh, … JS, L

    , Go, …

    Listener

    Speaker
    func I[T any](x T) T {
    return x
    }

    View Slide

  43. Gold’s Theorem

    En, Zh, … JS, L

    , Go, …

    Listener
    Go ≺ L


    Speaker
    func I[T any](x T) T {
    return x
    }

    View Slide

  44. Memorization

    1. 🜟 ꢯ 🜣
    2. 🜟 🜣 ꢯ
    3. ⩹ ꢯ ∅
    4. ⩹ 🜣 ∅

    View Slide

  45. Memorization

    1. 🜟 ꢯ 🜣
    2. 🜟 🜣 ꢯ
    3. ⩹ ꢯ ∅
    4. ⩹ 🜣 ∅

    View Slide

  46. All Possible Languages
 1. 🜟 ꢯ 🜣
    2. 🜟 🜣 ꢯ
    3. ⩹ ꢯ ∅
    4. ⩹ 🜣 ∅
    1.
    2. s1
    3. s2
    4. s1 s2
    5. s3
    6. s1 s3
    7. s2 s3
    8. s1 s2 s3
    9. s4
    10. s1 s4
    11. s2 s4
    12. s1 s2 s4
    13. s3 s4
    14. s1 s3 s4
    15. s2 s3 s4
    16. s1 s2 s3 s4

    View Slide

  47. All Possible Languages
 1. 🜟 ꢯ 🜣
    2. 🜟 🜣 ꢯ
    3. ⩹ ꢯ ∅
    4. ⩹ 🜣 ∅
    1.
    2. s1
    3. s2
    4. s1 s2
    5. s3
    6. s1 s3
    7. s2 s3
    8. s1 s2 s3
    9. s4
    10. s1 s4
    11. s2 s4
    12. s1 s2 s4
    13. s3 s4
    14. s1 s3 s4
    15. s2 s3 s4
    16. s1 s2 s3 s4

    Ah Lien

    Kiasu

    View Slide

  48. All Possible Languages
 1. 🜟 ꢯ 🜣
    2. 🜟 🜣 ꢯ
    3. ⩹ ꢯ ∅
    4. ⩹ 🜣 ∅
    1.
    2. s1
    3. s2
    4. s1 s2
    5. s3
    6. s1 s3
    7. s2 s3
    8. s1 s2 s3
    9. s4
    10. s1 s4
    11. s2 s4
    12. s1 s2 s4
    13. s3 s4
    14. s1 s3 s4
    15. s2 s3 s4
    16. s1 s2 s3 s4

    Ah Lien

    Kiasu

    View Slide

  49. All Possible Languages
 1. 🜟 ꢯ 🜣
    2. 🜟 🜣 ꢯ
    3. ⩹ ꢯ ∅
    4. ⩹ 🜣 ∅
    1.
    2. s1
    3. s2
    4. s1 s2
    5. s3
    6. s1 s3
    7. s2 s3
    8. s1 s2 s3
    9. s4
    10. s1 s4
    11. s2 s4
    12. s1 s2 s4
    13. s3 s4
    14. s1 s3 s4
    15. s2 s3 s4
    16. s1 s2 s3 s4

    Ah Lien

    Kiasu

    Chewxy
    🜟 ꢯ 🜣

    View Slide

  50. All Possible Languages
 1. 🜟 ꢯ 🜣
    2. 🜟 🜣 ꢯ
    3. ⩹ ꢯ ∅
    4. ⩹ 🜣 ∅
    1.
    2. s1
    3. s2
    4. s1 s2
    5. s3
    6. s1 s3
    7. s2 s3
    8. s1 s2 s3
    9. s4
    10. s1 s4
    11. s2 s4
    12. s1 s2 s4
    13. s3 s4
    14. s1 s3 s4
    15. s2 s3 s4
    16. s1 s2 s3 s4

    Ah Lien

    Kiasu

    Chewxy
    🜟 ꢯ 🜣
    L6! L2 | L4 | L6 | L8 | L10
    | L12 | L14 | L16

    View Slide

  51. Statistical Learning 101

    In order to generalize, a good learner cannot memorize!

    View Slide

  52. Large Language Models


    View Slide

  53. Neural Networks

    Y = σ(W’X + b)

    View Slide

  54. Y = σ(W’X + b)
    func NN[T, U any](x T) U
    Neural Networks


    View Slide

  55. Neural Networks

    Y = σ(W’X + b)

    View Slide

  56. Neural Networks

    Y = σ(W’X + b)

    View Slide

  57. Neural Networks

    Y = σ(W’X + b)

    View Slide

  58. Neural Networks

    Y = σ(W’X + b)

    View Slide

  59. Neural Networks

    Y = σ(W’X + b)

    View Slide

  60. Simple Linear Regression

    y = mx + c

    View Slide

  61. Neural Networks

    Y = σ(W’X + b)
    I

    View Slide

  62. Neural Networks

    Y = σ(W’X + b)
    I m

    View Slide

  63. Neural Networks

    Y = σ(W’X + b)
    I m c

    View Slide

  64. Neural Networks

    Y = σ(W’X + b)
    I
    [m,c]
    0

    View Slide

  65. Neural Networks

    σ
    2
    (W
    2
    ’Y = σ
    1
    (W
    1
    ’X + b
    1
    ) + b
    2
    )

    View Slide

  66. Deep Neural Networks

    Y = σ
    2
    (W
    2
    ’σ
    1
    (W
    1
    ’X + b
    1
    ) + b
    2
    )

    View Slide

  67. Deep Neural Networks

    Y = σ
    2
    (W
    2
    ’σ
    1
    (W
    1
    ’X + b
    1
    ) + b
    2
    )

    View Slide

  68. Deep Neural Networks

    Y = σ
    2
    (W
    2
    ’σ
    1
    (W
    1
    ’X + b
    1
    ) + b
    2
    )
    [0.3m, 0.6c]
    [0.7m, 0.4c]
    Note: “spreading out” of values of m and c is shown for illustration purposes only

    View Slide

  69. Training LLMs

    1. Pretraining
    2. Supervised finetuning
    3. Alignment

    View Slide

  70. Pretraining

    LLM
    “hello” “gophercon” “singapore”
    “hello gophercon singapore”
    “hello gophercon au”

    “ … ”
    “func add(x, y int) int {...”

    View Slide

  71. Supervised Finetuning

    LLM
    “q” “:” “answer” … “A” “:” …
    “input: summarize the following
    paragraph

    output: … ”
    “Q: Answer the following yes/no
    question by
    reasoning step-by-step.

    A: …”

    View Slide

  72. Alignment

    LLM
    Prompt
    a. …
    b. …
    c. …
    1. b
    2. a
    3. c

    View Slide

  73. What Do LLMs Learn?

    LLMs learn the grammar of a language
    and knowledge embedded in language

    View Slide

  74. Where Is Knowledge Found?

    Claim: LLMs have a world model.
    Counterclaim: A bag of words with gradient boosting
    has a world model
    Language Models Represent Space and Time https://arxiv.org/abs/2310.02207
    Bag of words with gradient boosting shows a world model https://twitter.com/ArthurB/status/1711475192461971860

    View Slide

  75. How To Test If LLMs Have Knowledge Outside of Language?

    1. Take something written in plain
    natural language.
    2. Replace noun and verbs with
    consistent random strings.
    3. Use it as a prompt to the LLM.

    View Slide

  76. How Do We Know LLMs Don’t Understand Arithmetic?

    I tried 22 times before I gave up!
    22 wrong answers later I give up

    View Slide

  77. Why Do LLMs Perform So Well?

    LLMs memorize the world!
    Quantifying Memorization Across Neural Language Models https://arxiv.org/abs/2202.07646

    View Slide

  78. Can LLMs Extract Knowledge From Structure?

    Definitions
    1. A point is that which has no parts.
    2. A line is a breadless length.
    3. The extremities of a line are points.
    4. A straight or right line is that which lies evenly between its
    extremities.
    5. A surface is that which has length and breadth only.
    6. A plane angle is the inclination of two lines to one another, in a
    plane, which meet together, but are not in the same direction.
    7. When one straight line landing on another straight line makes adjacent
    angles equal, each of these angles is called a right angle, and each of
    these lines is said to be perpendicular to the other.
    8. A figure is a surface enclosed on all sides by a line, or lines.
    9. A circle is a plane figure, bounded by one continuous line, called its
    circumference; and having a certain point within it (the center), from
    which all straight lines drawn to its circumference are equal.
    10. The distance of a length is its magnitude. The distance of a breadth is
    its magnitude.
    Postulates
    1. A straight line may be drawn from any one point to any other point.
    2. A finite straight line may be produced to any length in a straight line.
    3. A circle may be described with any center at any distance from that
    center.
    4. All right angles are equal to each other.
    Definitions
    1. A adthc is that which has no zvrts.
    2. A jiqi is a lpmvqdxless dacveq.
    3. The extremities of a jiqi are adthcs.
    4. A egezhlbj or hebra jiqi is that which lies evenly between its
    extremities.
    5. A wbkkgie is that which has dacveq and lpmvqdx only.
    6. A bmknx mduhm is the inclination of two jiqis to one another, in a
    bmknx, which meet together, but are not in the same direction.
    7. When one egezhlbj jiqi landing on another egezhlbj jiqi makes adjacent
    mduhms equal, each of these mduhms is called a hebra mduhm, and each of
    these jiqis is said to be perpendicular to the other.
    8. A mvjkcm is a wbkkgie enclosed on all sides by a jiqi, or jiqis.
    9. A xazrvj is a bmknx mvjkcm, bounded by one continuous jiqi, called its
    kmzohvxrcmjpq; and having a certain adthc within it (the oemhbe), from
    which all egezhlbj jiqis drawn to its kmzohvxrcmjpq are equal.
    10. The ijhwkmlg of a dacveq is its magnitude. The ijhwkmlg of a breadth is
    its magnitude.
    Postulates
    1. A egezhlbj jiqi may be drawn from any one adthc to any other adthc.
    2. A finite egezhlbj jiqi may be produced to any dacveq in a egezhlbj jiqi.
    3. A xazrvj may be described with any oemhbe at any ijhwkmlg from that
    oemhbe.
    4. All hebra mduhms are equal to each other.

    View Slide

  79. Can LLMs Extract Knowledge From Structure?

    Definitions
    1. A point is that which has no parts.
    2. A line is a breadless length.
    3. The extremities of a line are points.
    4. A straight or right line is that which lies evenly between its
    extremities.
    5. A surface is that which has length and breadth only.
    6. A plane angle is the inclination of two lines to one another, in a
    plane, which meet together, but are not in the same direction.
    7. When one straight line landing on another straight line makes adjacent
    angles equal, each of these angles is called a right angle, and each of
    these lines is said to be perpendicular to the other.
    8. A figure is a surface enclosed on all sides by a line, or lines.
    9. A circle is a plane figure, bounded by one continuous line, called its
    circumference; and having a certain point within it (the center), from
    which all straight lines drawn to its circumference are equal.
    10. The distance of a length is its magnitude. The distance of a breadth is
    its magnitude.
    Postulates
    1. A straight line may be drawn from any one point to any other point.
    2. A finite straight line may be produced to any length in a straight line.
    3. A circle may be described with any center at any distance from that
    center.
    4. All right angles are equal to each other.
    Definitions
    1. A adthc is that which has no zvrts.
    2. A jiqi is a lpmvqdxless dacveq.
    3. The extremities of a jiqi are adthcs.
    4. A egezhlbj or hebra jiqi is that which lies evenly
    between its extremities.
    5. A wbkkgie is that which has dacveq and lpmvqdx only.
    6. A bmknx mduhm is the inclination of two jiqis to one
    another, in a bmknx, which meet together, but are not in
    the same direction.
    7. When one egezhlbj jiqi landing on another egezhlbj
    jiqi makes adjacent mduhms equal, each of these mduhms is
    called a hebra mduhm, and each of these jiqis is said to
    be perpendicular to the other.
    8. A mvjkcm is a wbkkgie enclosed on all sides by a jiqi,
    or jiqis.
    9. A xazrvj is a bmknx mvjkcm, bounded by one continuous
    jiqi, called its kmzohvxrcmjpq; and having a certain
    adthc within it (the oemhbe), from which all egezhlbj
    jiqis drawn to its kmzohvxrcmjpq are equal.
    10. The ijhwkmlg of a dacveq is its magnitude. The
    ijhwkmlg of a breadth is its magnitude.ww

    View Slide

  80. Results

    ChatGPT
    If a jiqi is drawn intersecting two
    other jiqis and the sum of the
    internal mduhms on one side is less
    than two hebra mduhms, then the two
    jiqis will meet on that side if
    extended indefinitely.
    Bard
    If a jiqi falling on two jiqis
    makes the adjacent mduhms taken
    together less than two hebra
    mduhms, then the two jiqis, if
    produced indefinitely, meet on that
    side on which the sum of mduhms is
    less than two hebra mduhms.

    View Slide

  81. Results

    ChatGPT
    If a line is drawn intersecting two
    other lines and the sum of the
    internal angles on one side is less
    than two right angles, then the two
    lines will meet on that side if
    extended indefinitely.
    Bard
    If a line falling on two lines
    makes the adjacent angles taken
    together less than two right
    angles, then the two lines, if
    produced indefinitely, meet on that
    side on which the sum of angles is
    less than two right angles.

    View Slide

  82. Replacing “Postulate”

    ChatGPT
    Based on the definitions and the statements
    provided, it appears we are working with a set
    of geometric axioms or principles, albeit with
    unfamiliar terminology. This is reminiscent of
    Euclid's axioms.
    Taking inspiration from the nature of the
    previous statements and the definitions
    provided, a fifth statement could be:
    All jiqis drawn from the same oemhbe to the
    kmzohvxrcmjpq of a xazrvj are egezhlbj.
    Bard
    Fifth statement:
    All adthcs are equidistant from the oemhbe of a
    xazrvj.
    This statement can be inferred from the
    following definitions and statements:
    (...snipped…)

    View Slide

  83. No Parallel Postulate

    Parallel Postulate (Modern):
    Given a straight line and a point that is not on the
    line, there is only one line through the point that
    does not intersect with the given line.
    Fifth Postulate (Euclid):
    If two straight lines meet a third straight line so
    as to make the two interior angles on the same
    side less than two right angles, these two straight
    lines will meet if they be produced on the side on
    which the angles are less than two right angles.

    View Slide

  84. Why Do LLMs Generalize So Well?


    View Slide

  85. Types of Generalization

    ● Interpolative generalization
    ● Extrapolative generalization
    ● Abstractive generalization
    ● Inductive generalization
    ● Abductive generalization (???)
    Learning in High Dimension Always Amounts to Extrapolation https://arxiv.org/abs/2110.09485

    View Slide

  86. A monad is just a monoid in the category of endofunctors.
    What’s the problem?

    View Slide

  87. A monad is just a monoid in the category of endofunctors.
    What’s the problem?
    neural network convolution group Hopf algebra
    One day I will figure out how to put a manim animation on Google Slides so joke slides won’t be necessary to accompany a rather dry explanation

    View Slide

  88. How Do I Think About LLMs


    View Slide

  89. Key Takeaways

    1. Due to Gold’s, task specific LLMs are going to perform better, so finetune finetune
    finetune.
    2. LLMs memorize structures of language (smaller intrinsic dimension). Don’t
    confuse that for generalization.
    3. Generalization due to memorization of structure is the poor man’s
    generalization.

    View Slide

  90. Problems With The Current Approach


    View Slide

  91. Enthralled

    ● The common person cannot train
    their own LLMs.
    ● Corporations dictate what is
    acceptable and what is not.

    View Slide

  92. Models Are Too Big

    Courtesy Michael C Frank

    View Slide

  93. Models Are Too Big

    Overparameterized Models
    + Interpolative generalization.
    + Extrapolative generalization.
    ● Reasoning.
    – Minority samples fare way worse.

    View Slide

  94. What Next?


    View Slide

  95. Go


    View Slide

  96. Deep Learning in Go
    https://gorgonia.org

    View Slide

  97. Gorgonia Family

    gorgonia.org/gorgonia
    gorgonia.org/tensor
    gorgonia.org/cu
    gorgonia.org/golgi

    View Slide

  98. Why Go?

    1. Go imparts a good amount of
    mechanical sympathy on the
    programmer.
    2. Good concurrency story.
    3. Good tooling story.
    4. Good crossplatform development.
    5. Good syntax

    View Slide

  99. What Is Go Not Great At?

    1. Allowing programmers to express
    higher level thought.
    2. FFI.

    View Slide

  100. DEMO (screenshot backup)


    View Slide

  101. The Next Versions of Gorgonia

    The tensor package is genericized
    func Example_basics() {
    // Create a (2, 2)-Matrix of integers
    a := New(WithShape(2, 2), WithBacking([]int{1, 2, 3, 4}))
    fmt.Printf("a:\n%v\n", a)
    // Create a (2, 3, 4)-tensor of float32s
    b := New(WithBacking(Range(Float32, 0, 24)), WithShape(2, 3, 4))
    fmt.Printf("b:\n%1.1f", b)

    }

    View Slide

  102. The Next Versions of Gorgonia

    The tensor package is genericized
    func Example_basics() {
    // Create a (2, 2)-Matrix of integers
    a := New[int](WithShape(2, 2), WithBacking([]int{1, 2, 3, 4}))
    fmt.Printf("a:\n%v\n", a)
    // Create a (2, 3, 4)-tensor of float32s
    b := New[float32](WithBacking(gutils.Range[float32](0, 24)),
    WithShape(2, 3, 4))
    fmt.Printf("b:\n%1.1f", b)

    }

    View Slide

  103. The Next Version of Gorgonia

    New ways of defining computation graphs:
    ● Forwards-mode differentiation
    ● Backwards-mode differentiation
    ● Symbolic differentiation
    ● Reactive mode
    ● Hybrid of any of the above

    View Slide

  104. Generics Adds Expressivity, Subtracts Readability

    type hypothesis[DT any] interface { … }
    type Hypothesis[DT any, T hypothesis[DT]] interface {
    hypothesis[DT]
    Restart() T
    Propose() (prop T, logprob float64)
    }
    type Chain[DT any, T Hypothesis[DT, T]] struct { … }

    View Slide

  105. Generics Adds Expressivity, Subtracts Readability

    type Fodor[DTin, DTout any, T G[DTin, DTout, T], U M[DTin, DTout, T]] struct{

    }

    View Slide

  106. The Ask


    View Slide

  107. The End


    View Slide