Live data from Hacker News

Competitive Programming with AlphaCode

deepmind.com

1–10 of 415 posts

Re: Competitive Programming with AlphaCode

#2
Between this and OpenAI's Github Copilot "programming" will slowly start dying probably. What I mean by that is that sure, you have to learn how to program, but our time will be spent much more on just the design part and writing detailed documentation/specs and then we just have one of these AIs generate the code.

It's the next step. Binary code Historically its always been about abstracting and writing less code to do more.

Re: Competitive Programming with AlphaCode

#5
The example problem (essentially, is T a subsequence of S with deletions of size N) is a classic problem with no doubt dozens of implementations in AlphaCode's training set.

And yet, what a garbage solution it produces.

To illustrate the difference between intelligence and regurgitation, someone tell me what CoPilot generates for this:

  // A Go function to swap the sixth bit and seventeenth bit of a 32-bit signed integer.
Here is a human solution:

  func swap(x int32) int32 {
      const mask = 1 >11 ^ x) & mask
          xor2 = xor1 
CoPilot cannot reason numerically like this (understand "seventeenth bit" and "sixth bit" and generate the right code for that combination). It needs to understand the size of the gap between the bits, i.e., 11, and that's too hard.

Re: Competitive Programming with AlphaCode

#6
post #2

Between this and OpenAI's Github Copilot "programming" will slowly start dying probably. What I mean by that is that sure, you have to learn how to program, but our time will be spent much more on just the design part and writing detailed documentation/specs and then we just have one of these AIs generate the code. It's the next step. Binary code Historically its always been about abstracting and writing less code to…

Solving competitive programming problems is essentially solving hard combinatorial optimization problems. Throwing a massive amount of compute and gradient descent at the problem has always been possible. If I'm not mistaken what this does is reduce the representation of the problem to a state where it can run gradient descent and then tune parameters. The real magic is in finding structurally new approaches. If anything I'd say algorithms and math continue to be the core of programming. The particular syntax or level of abstraction don't matter so much.

Re: Competitive Programming with AlphaCode

#7

The example problem (essentially, is T a subsequence of S with deletions of size N) is a classic problem with no doubt dozens of implementations in AlphaCode's training set. And yet, what a garbage solution it produces. To illustrate the difference between intelligence and regurgitation, someone tell me what CoPilot generates for this: // A Go function to swap the sixth bit and seventeenth bit of a 32-bit signed inte…

Here is what CoPilot wrote in Python:

  # A function to swap the sixth bit and seventeenth bit of a 32-bit signed integer.
  def swap_bits(x):
      # Get the value of the sixth bit.
      bit6 = x & (1 > 5
      bit17 = bit17 >> 16

      # Combine the swapped values of the sixth and seventeenth bit.
      x = x ^ (bit6 
It actually synthesised about 10 viable solutions. Some interesting ones:

  def swap_six_seventeen(x):
      # Get the binary representation of the integer.
      binary = bin(x)[2:]
      # Add zeros to the beginning of the binary representation.
      binary = '0' * (32 - len(binary)) + binary
      # Swap the sixth and seventeenth bit.
      binary = binary[:5] + binary[17] + binary[5:17] + binary[18:]
      # Convert the binary back to an integer.
      return int(binary, 2)

Re: Competitive Programming with AlphaCode

#8

The example problem (essentially, is T a subsequence of S with deletions of size N) is a classic problem with no doubt dozens of implementations in AlphaCode's training set. And yet, what a garbage solution it produces. To illustrate the difference between intelligence and regurgitation, someone tell me what CoPilot generates for this: // A Go function to swap the sixth bit and seventeenth bit of a 32-bit signed inte…

Ask and you shall receive, here is the output it gave me: // Write a Go function to swap the sixth bit and seventeenth bit of a 32-bit signed integer.

    package main
    
    import (
     "fmt"
     "math"
    )
    
    func main() {
     var a int32 = 0b1010101010101010101010101010101010101010101010101010101010101010
     fmt.Printf("%b\n", a)
     fmt.Printf("%b\n", swapBits(a, 6, 17))
    }
    
    func swapBits(a int32, i int, j int) int32 {
     // convert to binary
     bin := fmt.Sprintf("%b", a)
     // get the bits
     bit1 := bin[i-1 : i]
     bit2 := bin[j-1 : j]
     // swap the bits
     bin = bin[:i-1] + bit2 + bin[i:]
     bin = bin[:j-1] + bit1 + bin[j:]
     // convert back to int
     return int32(bin2int(bin))
    }
    
    func bin2int(bin string) int64 {
     var sum int64
     for i, v := range bin {
      if v == '1' {
       sum += int64(math.Pow(2, float64(len(bin)-i-1)))
      }
     }
     return sum
    }

Re: Competitive Programming with AlphaCode

#9
post #2

Between this and OpenAI's Github Copilot "programming" will slowly start dying probably. What I mean by that is that sure, you have to learn how to program, but our time will be spent much more on just the design part and writing detailed documentation/specs and then we just have one of these AIs generate the code. It's the next step. Binary code Historically its always been about abstracting and writing less code to…

Creating a higher level abstraction is something people have been trying to do for decades with so-called 4th-generation languages. At some point, abstracting away too much makes a tool too cookie-cutter, and suddenly deviating from it causes more difficulty.

Re: Competitive Programming with AlphaCode

#10

The example problem (essentially, is T a subsequence of S with deletions of size N) is a classic problem with no doubt dozens of implementations in AlphaCode's training set. And yet, what a garbage solution it produces. To illustrate the difference between intelligence and regurgitation, someone tell me what CoPilot generates for this: // A Go function to swap the sixth bit and seventeenth bit of a 32-bit signed inte…

[deleted]
Post reply on HN