Git Product home page Git Product logo

binoculars's Introduction

  • ๐Ÿ‘‹ Hi, Iโ€™m Abhimanyu Hans.
  • ๐Ÿ’ผ I'm a graduate student at the Department of Computer Science at the University of Maryland, College Park.
  • ๐Ÿ‘€ Iโ€™m interested in language models, security, and robustness.
  • ๐Ÿค Iโ€™m always looking to collaborate on ML projects! Reach out! :)
  • ๐Ÿ“ซ Best way to reach me is via [email protected] or on Twitter/X.

binoculars's People

Contributors

aesuli avatar ahans30 avatar jstrong-scottlogic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

binoculars's Issues

never get the result

CPU: Cor i7 8th gen
GPU: 8GB
RAM: 40 GB

But when I ran the script, it ran into the local server but never finished its task. It continuously counts its time. Short to long text, I tried everything possible variation, but it never completed its analysis. Is there anything I need to adjust? Whatever the warning message, I already solved the PC configuration.

Demo no longer working

Is it possible to fix the demo? It currently gives a runtime error.
(Runtime error
Space failed. Exit code: 1. Reason: :)

1% threshold

Is there any chance you could share the 1% threshold value, I am trying to compare? I cant seem to recalibrate for with the M4 to land on the same value

cannot import Binoculars.

binoculars has no module named Binoculars.
specifically after installing binoculars as per given instructions,

 from binoculars import Binoculars

this line throws error as binoculars has no module named Binoculars

Link to Evaluation Datasets

While the Ghostbuster and Open Orca datasets are available, it would be great to be able replicate your results, or use them as a benchmark, with the Falcon/Llama examples you generated from CCNews, PubMed, and CNN data. Please share this data if you can!

How to compute AUROC using the Binocular scores?

The additional results in the appendix section of the paper report AUC scores. How do you compute the AUROC scores using the binocular scores? A script to do this or pseudocode would be super helpful. Thanks!

fpr threshold

What does BINOCULARS_FPR_THRESHOLD of 0.8536432310785527 correspond to? Is that 1% or 0.01% in the paper?

Loading Falcon using legacy code

When using Binoculars() the following warning is shown:

WARNING: You are currently loading Falcon using legacy code contained in the model repository. Falcon has now been fully ported into the Hugging Face transformers library. For the most up-to-date and high-performance version of the Falcon model code, please update to the latest version of transformers and then load the model without the trust_remote_code=True argument.

Using python 3.9, macOS, freshly downloaded and installed repo from here

Figure 7

Many thanks for the paper, I am struggling a bit with Fig 7.

How come false negatives are so high? Where are the generated russian urdu etc samples coming from?

Replicating Figure 4

Congrats on the great work! I'm trying to verify that I'm running the detector correctly by replicating some numbers interpreted from Figure 4 in the paper. On CC News, TPR at 0.01 (1%) FPR seems to be slightly higher than 0.6. Is that correct?

With outputs from Binoculars/datasets/core/cc_news/cc_news-llama2_13.jsonl, using falcon-7b as the observer and falcon-7b-instruct as the performer (default setting), I ran the following code to compute TPR at 0.01 (1%) FPR and got 0.595, which seems to be lower than what I observed in Figure 4.

path = "Binoculars/datasets/core/cc_news/cc_news-llama2_13.jsonl"
data = [json.loads(line) for line in open(path, 'r')]

human = [d['text'] for d in data]
model = [d['meta-llama-Llama-2-13b-hf_generated_text_wo_prompt'] for d in data]

bino = Binoculars()
scores = []
for i, (h, f) in tqdm.tqdm(enumerate(zip(human, model)), total=len(human)):
    score_human = bino.compute_score(h)
    score_model = bino.compute_score(f)
    scores.append({
        'gold': score_human,
        'model': score_model
    })

labels = [0 for _ in range(len(scores))] + [1 for _ in range(len(scores))]
bl_scores = [s['gold'] for s in scores] + [s['model'] for s in scores]
bl_scores = [s * (-1) for s in bl_scores]  # reverse scale
fpr, tpr, thresholds = roc_curve(labels, bl_scores, pos_label=1)
fpr_threshold = 0.01
tpr_at_fpr_1 = 0
threshold_at_fpr_1 = 0
for i, f in enumerate(fpr):
    if f > fpr_threshold:
        tpr_at_fpr_1 = tpr[i-1]
        threshold_at_fpr_1 = thresholds[i-1]
        break
print(f"tpr at fpr {fpr_threshold} = {tpr_at_fpr_1}, threshold = {threshold_at_fpr_1}")

Is there something wrong with my code? Or did you you a different observer-performer combo for Figure 4? Please let me know, thanks!

Pad_token not set

When running the main.py in the repo it gives this error

Using pad_token, but it is not set yet.

Using python 3.9, macOs, freshly downloaded repo

pip install fails

This is the error when I try to follow instruction pip install -e . :

Running setup.py develop for Binoculars
    error: subprocess-exited-with-error
    
    ร— python setup.py develop did not run successfully.
    โ”‚ exit code: 1
    โ•ฐโ”€> [27 lines of output]
        /opt/conda/lib/python3.10/site-packages/setuptools/command/develop.py:40: EasyInstallDeprecationWarning: easy_install command is deprecated.
        !!
        
                ********************************************************************************
                Please avoid running ``setup.py`` and ``easy_install``.
                Instead, use pypa/build, pypa/installer or other
                standards-based tools.
        
                See https://github.com/pypa/setuptools/issues/917 for details.
                ********************************************************************************
        
        !!
          easy_install.initialize_options(self)
        /opt/conda/lib/python3.10/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
        !!
        
                ********************************************************************************
                Please avoid running ``setup.py`` directly.
                Instead, use pypa/build, pypa/installer or other
                standards-based tools.
        
                See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
                ********************************************************************************
        
        !!
          self.initialize_options()
        error: could not create 'Binoculars.egg-info': Read-only file system
        [end of output]
    
    note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

ร— python setup.py develop did not run successfully.
โ”‚ exit code: 1
โ•ฐโ”€> [27 lines of output]
    /opt/conda/lib/python3.10/site-packages/setuptools/command/develop.py:40: EasyInstallDeprecationWarning: easy_install command is deprecated.
    !!
    
            ********************************************************************************
            Please avoid running ``setup.py`` and ``easy_install``.
            Instead, use pypa/build, pypa/installer or other
            standards-based tools.
    
            See https://github.com/pypa/setuptools/issues/917 for details.
            ********************************************************************************
    
    !!
      easy_install.initialize_options(self)
    /opt/conda/lib/python3.10/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
    !!
    
            ********************************************************************************
            Please avoid running ``setup.py`` directly.
            Instead, use pypa/build, pypa/installer or other
            standards-based tools.
    
            See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
            ********************************************************************************
    
    !!
      self.initialize_options()
    error: could not create 'Binoculars.egg-info': Read-only file system
    [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.

Threshold tuning

Would you be able to put up the code you used to tune the threshold for the classifier? The value is highly sensitive to the choice of performer and observer model

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.