Skip to content

Instantly share code, notes, and snippets.

@yoavg
yoavg / instruct-to-not-hallucinate.md
Created September 9, 2024 20:23
Is telling a model to "not hallucinate" absurd?

Is telling a model to "not hallucinate" absurd?

Can you tell an LLM "don't hallucinate" and expect it to work? my gut reaction was "oh this is so silly" but upon some reflection, it really isn't. There is actually no reason why it shouldn't work, especially if it was preference-fine-tuned on instructions with "don't hallucinate" in them, and if it a recent commercial model, it likely was.

What does an LLM need in order to follow an instruction? It needs two things:

  1. an ability to perform then task. Something in its parameters/mechanism should be indicative of the task objective, in a way that can be influenced. (In our case, it should "know" when it hallucinates, and/or should be able to change or adapt its behavior to reduce the chance of hallucinations.)
  2. an ability to ground the instruction: the model should be able to associate the requested behavior with its parameters/mechanisms. (In our case, the model should associate "don't hallucinate" with the behavior related to 1).
@winuxue
winuxue / puppeteer-ubuntu-1804.md
Created May 22, 2019 01:15
Solution for common dependences issues using puppeteer in ubuntu 18.04 (Bionic)

puppeteer dependeces in ubuntu 18.04 (Bionic)

error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory

sudo apt-get install libnss3

error while loading shared libraries: libXss.so.1: cannot open shared object file: No such file or directory

sudo apt-get install libxss1
@ryandesign
ryandesign / add_oclp_ext4_driver.sh
Last active January 6, 2025 12:00
Adds ext4 driver to OpenCore Legacy Patcher so that a Linux partition can be selected.
#!/bin/bash
# SPDX-FileCopyrightText: © 2024 Ryan Carsten Schmidt <https://github.com/ryandesign>
# SPDX-License-Identifier: MIT
#
# Adds ext4 driver to OpenCore Legacy Patcher so that a Linux partition can be selected.
# Based on instructions by rikerjoe at:
# https://tinkerdifferent.com/threads/dual-boot-linux-mint-21-2-and-macos-with-opencore-legacy-patcher-and-opencore-bootpicker.3115/
set -u
@jboner
jboner / latency.txt
Last active January 6, 2025 11:59
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
Registered Name: https://zhile.io
License Key: 48891cf209c6d32bf4
@iam-veeramalla
iam-veeramalla / gist:7e32999189f4aa9064334d1d27bd877c
Created January 3, 2025 11:14
EKS Cluster Creation and Teardown
# Create EKS Cluster
eksctl create cluster --name=observability \
--region=us-east-1 \
--zones=us-east-1a,us-east-1b \
--without-nodegroup
eksctl utils associate-iam-oidc-provider \
--region us-east-1 \
--cluster observability \
;; Challenge: find all the bugs in this small functional compiler
#lang racket
(provide (all-defined-out))
(define verbose-mode (make-parameter #t))
(define i-am-a-mac (make-parameter #f))
;;
;; Our compiler will have several layers
@thecodeholic
thecodeholic / php.json
Created February 26, 2024 19:29
PHP/Laravel Live snippets for VSCode
{
"Create public function": {
"prefix": "pubf",
"body": [
"public function $1()",
"{",
"\t$2",
"}",
],
"description": "Create public function"
@auramagi
auramagi / WaterfallLayout.swift
Created June 27, 2022 10:52
Waterfall Layout with SwiftUI Layout protocol
import SwiftUI
struct ContentView: View {
typealias Item = (Color, CGFloat)
@State private var columnCount = 3
@State private var isWaterfall = true
@State var items: [Item] = [
@JuniorDjjr
JuniorDjjr / fakeMainOutputFile.sc
Created November 11, 2021 17:39
SA main.scm source code leaked from GTA SA The Definitive Edition
This file has been truncated, but you can view the full file.
// *****************************************************************************************
// *****************************************************************************************
// *****************************************************************************************
// ****************************************PC SA Main Script********************************
// *****************************************************************************************
// *****************************************************************************************
// *****************************************************************************************
SCRIPT_NAME MAIN //NEW MAIN