sisyphean

joined 1 year ago
MODERATOR OF
[–] sisyphean 5 points 1 year ago (4 children)

You can put spoilers in posts or comments this way:

TitleSecret

Here is how it renders:

TitleSecret

(AFAIK apps don't render these correctly, only the website)

[–] sisyphean 2 points 1 year ago* (last edited 1 year ago) (1 children)

This is a very useful trick, but since the June update you can also use the "function calling" feature to extract structured data. I converted the example in the blog post (I used GPT-4 to convert the TypeScript type into a JSON schema):

curl https://api.openai.com/v1/chat/completions -u :$OPENAI_API_KEY -H 'Content-Type: application/json' -d '{
  "model": "gpt-3.5-turbo-0613",
  "messages": [
    {"role": "user", "content": "A user has performed the following searches and visited the following sites recently: weather in New York, NYC weather, NYC chance of rain today, is New York a rainy city (They may or may not have changed goals half way through this session.)"}
  ],
  "functions": [
    {
      "name": "report_browsing_goal_analysis",
      "description": "Reports the analysis the users recent browsing activity",
      "parameters": {
        "type": "object",
        "properties": {
            "goal": {
                "type": "string",
                "description": "The users consistent recent browsing goal"
            },
            "confidence": {
                "type": "string",
                "description": "How confident the analysis engine is in this goal",
                "enum": ["very low", "low", "med", "high", "very high"]
            },
            "switched": {
                "type": "boolean",
                "description": "Whether or not the user seems to have switched goals recently"
            },
            "advice": {
                "type": "array",
                "description": "An array of up to 3 creative, specific, non-obvious ways the system recommends for the user to meet their current goal. (Do not return generic suggestions like subscribe to a newsletter or do a Google search, instead recommend specific actions that the user should consider.)",
                "items": {
                    "type": "object",
                    "properties": {
                        "text": {
                            "type": "string"
                        },
                        "probabilityOfBeingUseful": {
                            "type": "string",
                            "enum": ["very low", "low", "med", "high", "very high"]
                        },
                        "creativity": {
                            "type": "string",
                            "enum": ["very low", "low", "med", "high", "very high"]
                        },
                        "funLevel": {
                            "type": "string",
                            "enum": ["very low", "low", "med", "high", "very high"]
                        }
                    },
                    "required": ["text", "probabilityOfBeingUseful", "creativity", "funLevel"]
                },
                "maxItems": 3
            }
        },
        "required": ["goal", "confidence", "switched", "advice"]
    }
    }
  ]
}'

This is what the API returned:

{
  "id": "chatcmpl-7Xd4BPsW9QBuk46BJRZRCNoFpJtV9",
  "object": "chat.completion",
  "created": 1688249351,
  "model": "gpt-3.5-turbo-0613",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": null,
        "function_call": {
          "name": "report_browsing_goal_analysis",
          "arguments": "{\n  \"goal\": \"weather in New York\",\n  \"confidence\": \"high\",\n  \"switched\": false,\n  \"advice\": [\n    {\n      \"text\": \"Check the hourly weather forecast for New York to plan your activities.\",\n      \"probabilityOfBeingUseful\": \"high\",\n      \"creativity\": \"high\",\n      \"funLevel\": \"low\"\n    },\n    {\n      \"text\": \"Subscribe to a weather alert service to stay updated on the weather in New York.\",\n      \"probabilityOfBeingUseful\": \"medium\",\n      \"creativity\": \"medium\",\n      \"funLevel\": \"low\"\n    },\n    {\n      \"text\": \"Join a local weather enthusiasts group to discuss weather patterns in New York.\",\n      \"probabilityOfBeingUseful\": \"low\",\n      \"creativity\": \"high\",\n      \"funLevel\": \"high\"\n    }\n  ]\n}"
        }
      },
      "finish_reason": "function_call"
    }
  ],
  "usage": {
    "prompt_tokens": 303,
    "completion_tokens": 194,
    "total_tokens": 497
  }
}

Here is just the JSON result extracted:

{
  "goal": "weather in New York",
  "confidence": "high",
  "switched": false,
  "advice": [
    {
      "text": "Check the hourly weather forecast for New York to plan your activities.",
      "probabilityOfBeingUseful": "high",
      "creativity": "high",
      "funLevel": "low"
    },
    {
      "text": "Subscribe to a weather alert service to stay updated on the weather in New York.",
      "probabilityOfBeingUseful": "medium",
      "creativity": "medium",
      "funLevel": "low"
    },
    {
      "text": "Join a local weather enthusiasts group to discuss weather patterns in New York.",
      "probabilityOfBeingUseful": "low",
      "creativity": "high",
      "funLevel": "high"
    }
  ]
}

Pretty cool, isn't it?

(BTW this was GPT-3.5)

[–] sisyphean 8 points 1 year ago* (last edited 1 year ago)

TIL. Thank you! (Now I will ssh into all my VPSes and set this up!)

(cool username btw)

[–] sisyphean 1 points 1 year ago

Hahaha this is good

You should post it into programming humor!

[–] sisyphean 1 points 1 year ago

Fair enough, I can understand the emphasis on mod autonomy after the recent Reddit events. I really like this instance and appreciate the work you and the other admins do to make this a great place.

[–] sisyphean 1 points 1 year ago (2 children)

You seem to find some interesting corner cases :)

[–] sisyphean 1 points 1 year ago

Interesting, for some reason (maybe because the raw URL returns plain text instead of HTML), the unfluff library I use for extracting the text content gets confused and returns an empty string. I'll try to handle this case in a smarter way in the bot, thanks for reporting it!

[–] sisyphean 2 points 1 year ago

Currently it's only possible by replying to your own comment and mentioning the bot in it.

[–] sisyphean 6 points 1 year ago (2 children)

First, I'd like to thank @Ategon for their work on these icons and also for running this poll to determine what people who care about the issue want.

It's no secret that I vastly preferred the "All Unified" option - the coherent visual identity would not only help recognition across different instances, but it would also strengthen the community and the sense of belonging on this instance.

With this in mind, I find myself somewhat puzzled by the this remark in the post:

Community mods though have the final say in what their community icon looks like and can choose not to follow this result if they want

While the question of icons might seem minor (maybe even trivial), allowing this would set a precedent that undermines the effectiveness of such polls in the future. Everyone who cared about the issue had the opportunity to vote for an entire week, and the "All Unified" option won by an overwhelming majority.

If even one mod disregarded this result, it would run counter to the result of the poll, effectively making the end state undesirable for the supporters of any of the options: the icons wouldn't be "all unified", the "general unified" option wouldn't happen either because at least some language-specific communities would also have the unified icon, and obviously, "no unified style" voters would be dissatisfied too.

[–] sisyphean 4 points 1 year ago

I think I will add an exception to the bot for medium.com pages that explains this briefly.

[–] sisyphean 5 points 1 year ago (1 children)

Unfortunately Medium uses some tricks that make it almost impossible to scrape the content.

(Honestly I have no idea why so many people use that site, it’s full of dark patterns just like Reddit, Quora, etc.)

[–] sisyphean 2 points 1 year ago

Oh, I see. Now it answered my JavaScript question.

Though the "..." also had its mysterious charm :)

11
LLM Powered Autonomous Agents (lilianweng.github.io)
submitted 1 year ago by sisyphean to c/auai
 

TL;DR (by GPT-4 🤖)

The article discusses the concept of building autonomous agents powered by Large Language Models (LLMs), such as AutoGPT, GPT-Engineer, and BabAGI. These agents use LLMs as their core controller, with key components including planning, memory, and tool use. Planning involves breaking down tasks into manageable subgoals and self-reflecting on past actions to improve future steps. Memory refers to the agent's ability to utilize short-term memory for in-context learning and long-term memory for retaining and recalling information. Tool use allows the agent to call external APIs for additional information. The article also discusses various techniques and frameworks for task decomposition and self-reflection, different types of memory, and the use of external tools to extend the agent's capabilities. It concludes with case studies of LLM-empowered agents for scientific discovery.

Notes (by GPT-4 🤖)

LLM Powered Autonomous Agents

  • The article discusses the concept of building agents with Large Language Models (LLMs) as their core controller, with examples such as AutoGPT, GPT-Engineer, and BabAGI. LLMs have the potential to be powerful general problem solvers.

Agent System Overview

  • The LLM functions as the agent’s brain in an LLM-powered autonomous agent system, complemented by several key components:
    • Planning: The agent breaks down large tasks into smaller subgoals and can self-reflect on past actions to improve future steps.
    • Memory: The agent utilizes short-term memory for in-context learning and long-term memory to retain and recall information over extended periods.
    • Tool use: The agent can call external APIs for extra information that is missing from the model weights.

Component One: Planning

  • Task Decomposition: Techniques like Chain of Thought (CoT) and Tree of Thoughts are used to break down complex tasks into simpler steps.
  • Self-Reflection: Frameworks like ReAct and Reflexion allow the agent to refine past action decisions and correct previous mistakes. Chain of Hindsight (CoH) and Algorithm Distillation (AD) are methods that encourage the model to improve on its own outputs.

Component Two: Memory

  • The article discusses the different types of memory in human brains and how they can be mapped to the functions of an LLM. It also discusses Maximum Inner Product Search (MIPS) for fast retrieval from the external memory.

Tool Use

  • The agent can use external tools to extend its capabilities. Examples include MRKL, TALM, Toolformer, ChatGPT Plugins, OpenAI API function calling, and HuggingGPT.
  • API-Bank is a benchmark for evaluating the performance of tool-augmented LLMs.

Case Studies

  • The article presents case studies of LLM-empowered agents for scientific discovery, such as ChemCrow and a system developed by Boiko et al. (2023). These agents can handle autonomous design, planning, and performance of complex scientific experiments.
346
GITar Hero (programming.dev)
 
19
TOML in Python (til.simonwillison.net)
submitted 1 year ago by sisyphean to c/python
 

👋 Hello everyone, welcome to our very first Weekly Discussion thread!

This week, we're focusing on the applications of AI that you've found particularly noteworthy.

We're not just looking for headline-making AI applications. We're interested in the tools that have made a real difference in your day-to-day routine, or a unique AI feature that you've found useful. Have you discovered a new way to utilize ChatGPT? Perhaps Stable Diffusion or Midjourney has helped you generate an image that you're proud of?

Let's share our knowledge and learn more about the various applications of AI. Looking forward to your contributions.

21
submitted 1 year ago* (last edited 1 year ago) by sisyphean to c/auai
 

TL;DR (by GPT-4 🤖):

Prompt Engineering, or In-Context Prompting, is a method used to guide Language Models (LLMs) towards desired outcomes without changing the model weights. The article discusses various techniques such as basic prompting, instruction prompting, self-consistency sampling, Chain-of-Thought (CoT) prompting, automatic prompt design, augmented language models, retrieval, programming language, and external APIs. The effectiveness of these techniques can vary significantly among models, necessitating extensive experimentation and heuristic approaches. The article emphasizes the importance of selecting diverse and relevant examples, giving precise instructions, and using external tools to enhance the model's reasoning skills and knowledge base.

Notes (by GPT-4 🤖):

Prompt Engineering: An Overview

  • Introduction
    • Prompt Engineering, also known as In-Context Prompting, is a method to guide the behavior of Language Models (LLMs) towards desired outcomes without updating the model weights.
    • The effectiveness of prompt engineering methods can vary significantly among models, necessitating extensive experimentation and heuristic approaches.
    • This article focuses on prompt engineering for autoregressive language models, excluding Cloze tests, image generation, or multimodality models.
  • Basic Prompting
    • Zero-shot and few-shot learning are the two most basic approaches for prompting the model.
    • Zero-shot learning involves feeding the task text to the model and asking for results.
    • Few-shot learning presents a set of high-quality demonstrations, each consisting of both input and desired output, on the target task.
  • Tips for Example Selection and Ordering
    • Examples should be chosen that are semantically similar to the test example.
    • The selection of examples should be diverse, relevant to the test sample, and in random order to avoid biases.
  • Instruction Prompting
    • Instruction prompting involves giving the model direct instructions, which can be more token-efficient than few-shot learning.
    • Models like InstructGPT are fine-tuned with high-quality tuples of (task instruction, input, ground truth output) to better understand user intention and follow instructions.
  • Self-Consistency Sampling
    • Self-consistency sampling involves sampling multiple outputs and selecting the best one out of these candidates.
    • The criteria for selecting the best candidate can vary from task to task.
  • Chain-of-Thought (CoT) Prompting
    • CoT prompting generates a sequence of short sentences to describe reasoning logics step by step, leading to the final answer.
    • CoT prompting can be either few-shot or zero-shot.
  • Automatic Prompt Design
    • Automatic Prompt Design involves treating prompts as trainable parameters and optimizing them directly on the embedding space via gradient descent.
  • Augmented Language Models
    • Augmented Language Models are models that have been enhanced with reasoning skills and the ability to use external tools.
  • Retrieval
    • Retrieval involves completing tasks that require latest knowledge after the model pretraining time cutoff or internal/private knowledge base.
    • Many methods for Open Domain Question Answering depend on first doing retrieval over a knowledge base and then incorporating the retrieved content as part of the prompt.
  • Programming Language and External APIs
    • Some models generate programming language statements to resolve natural language reasoning problems, offloading the solution step to a runtime such as a Python interpreter.
    • Other models are augmented with text-to-text API calls, guiding the model to generate API call requests and append the returned result to the text sequence.
 

cross-posted from: https://programming.dev/post/222613

Although I prefer the Pro Git book, it's clear that different resources are helpful to different people. For those looking to get an understanding of Git, I've linked to Git for Beginners: Zero to Hero 🐙

The author of "Git for Beginners: Zero to Hero 🐙" posted the following on Reddit:

Hey there folks!

I've rewritten the git tutorial. I've used over the years whenever newbies at work and friends come to me with complex questions but lack the git basics to actually learn.

After discussing my git shortcuts and aliases elsewhere and over DMs it was suggested to me that I share it here.

I hope it helps even a couple of y'all looking to either refresh, jumpstart or get a good grasp of how common git concepts relate to one another !

It goes without saying, that any and all feedback is welcome and appreciated 👍

TL;DR: re-wrote a git tutorial that has helped friends and colleagues better grasp of git https://jdsalaro.com/blog/git-tutorial/

EDIT:

I've been a bit overwhelmed by the support and willingness to provide feedback, so I've enabled hypothes.is on https://jdsalaro.com for /u/NervousQuokka and anyone else wanting chime in. You can now highlight and comment snippets. ⚠️ Please join the feedback@jdsalaro group via this link https://hypothes.is/groups/BrRxenZW/feedback-jdsalaro so any highlights, comments, and notes are visible to me and stay nicely grouped. Using hypothes.is for this is an experiment for me, so let's see how it goes :)

https://old.reddit.com/r/learnprogramming/comments/14i14jv/rewrote_my_zero_to_hero_git_tutorial_and_was_told/

 

cross-posted from: https://programming.dev/post/216322

From the “About” section:

goblin.tools is a collection of small, simple, single-task tools, mostly designed to help neurodivergent people with tasks they find overwhelming or difficult.

Most tools will use AI technologies in the back-end to achieve their goals. Currently this includes OpenAI's models. As the tools and backend improve, the intent is to move to an open source alternative.

The AI models used are general purpose models, and so the accuracy of their output can vary. Nothing returned by any of the tools should be taken as a statement of truth, only guesswork. Please use your own knowledge and experience to judge whether the result you get is valid.

 

cross-posted from: https://programming.dev/post/216322

From the “About” section:

goblin.tools is a collection of small, simple, single-task tools, mostly designed to help neurodivergent people with tasks they find overwhelming or difficult.

Most tools will use AI technologies in the back-end to achieve their goals. Currently this includes OpenAI's models. As the tools and backend improve, the intent is to move to an open source alternative.

The AI models used are general purpose models, and so the accuracy of their output can vary. Nothing returned by any of the tools should be taken as a statement of truth, only guesswork. Please use your own knowledge and experience to judge whether the result you get is valid.

 

From the “About” section:

goblin.tools is a collection of small, simple, single-task tools, mostly designed to help neurodivergent people with tasks they find overwhelming or difficult.

Most tools will use AI technologies in the back-end to achieve their goals. Currently this includes OpenAI's models. As the tools and backend improve, the intent is to move to an open source alternative.

The AI models used are general purpose models, and so the accuracy of their output can vary. Nothing returned by any of the tools should be taken as a statement of truth, only guesswork. Please use your own knowledge and experience to judge whether the result you get is valid.

262
Fixed (programming.dev)
 
19
submitted 1 year ago* (last edited 1 year ago) by sisyphean to c/auai
 

Original tweet:

https://twitter.com/goodside/status/1672121754880180224?s=46&t=OEG0fcSTxko2ppiL47BW1Q

Text:

If you put violence, erotica, etc. in your code Copilot just stops working and I happen to need violence, erotica, etc. in Jupyter for red teaming so I always have to make an evil.⁠py to sequester constants for import.

not wild about this. please LLMs i'm trying to help you

(screenshot of evil.py full of nasty things)

 
view more: ‹ prev next ›